Module: Dumper::Utility::Log
Instance Method Summary collapse
Instance Method Details
#log(msg, level = :info) ⇒ Object
14 15 16 17 18 |
# File 'lib/dumper/utility/log.rb', line 14 def log(msg, level=:info) stdout_logger.send level, "** [Dumper] " + msg return unless true #should_log? logger.send level, msg end |
#log_last_error ⇒ Object
20 21 22 23 |
# File 'lib/dumper/utility/log.rb', line 20 def log_last_error log [ $!.class.name, $!.to_s ].join(', ') log ("\n" << $!.backtrace.join("\n")), :debug end |
#logger ⇒ Object
6 7 8 |
# File 'lib/dumper/utility/log.rb', line 6 def logger @@logger ||= Dumper::Utility::SlimLogger.new("#{Rails.root}/log/dumper_agent.log", 1, 10.megabytes) end |
#stdout_logger ⇒ Object
10 11 12 |
# File 'lib/dumper/utility/log.rb', line 10 def stdout_logger @@stdout_logger ||= Dumper::Utility::SlimLogger.new(STDOUT) end |