lib/marvin/logger.rb in Sutto-marvin-0.1.0.20081014 vs lib/marvin/logger.rb in Sutto-marvin-0.1.0.20081016
- old
+ new
@@ -6,10 +6,11 @@
cattr_accessor :logger
class << self
def setup
- self.logger ||= ::Logger.new(STDOUT)
+ log_path = Marvin::Settings.root / "log/#{Marvin::Settings.environment}.log"
+ self.logger ||= ::Logger.new(Marvin::Settings.daemon? ? log_path : STDOUT)
end
def method_missing(name, *args, &blk)
self.setup # Ensure the logger is setup
self.logger.send(name, *args, &blk)
\ No newline at end of file