lib/lanes/logger.rb in lanes-0.5.6 vs lib/lanes/logger.rb in lanes-0.6.0
- old
+ new
@@ -3,13 +3,13 @@
module Lanes
class MultiDestinationLogger
def initialize
- @targets = [
- STDOUT,
+ @targets = [STDOUT]
+ @targets.push(
File.open("log/#{Lanes.config.environment}.log", "a")
- ]
+ ) if File.writable?("log")
Lanes.config.get(:environment) do
@targets.each{|t| t.sync = ! Lanes.env.production? }
end
end