Module: BammLog::Formatter
Instance Method Summary collapse
Instance Method Details
#call_formatted(stamp, msg) ⇒ Object
8 9 10 |
# File 'lib/bamm_log/formatter.rb', line 8 def call_formatted(stamp, msg) "[#{stamp.to_s(:log)}] #{msg}\n" end |
#get_message(msg) ⇒ Object
4 5 6 |
# File 'lib/bamm_log/formatter.rb', line 4 def (msg) "#{String === msg ? msg : msg.inspect}" end |
#included(klass) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/bamm_log/formatter.rb', line 12 def included(klass) ::Logger::Formatter.module_eval do def call(severity, , progname, msg) Formatter.call_formatted , Formatter.(msg) end end end |