Class: Taskinator::Logging::Pretty
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Taskinator::Logging::Pretty
- Defined in:
- lib/taskinator/logger.rb
Instance Method Summary collapse
-
#call(severity, time, program_name, message) ⇒ Object
Provide a call() method that returns the formatted message.
- #context ⇒ Object
Instance Method Details
#call(severity, time, program_name, message) ⇒ Object
Provide a call() method that returns the formatted message.
17 18 19 |
# File 'lib/taskinator/logger.rb', line 17 def call(severity, time, program_name, ) "#{time.utc.iso8601} #{::Process.pid} TID-#{Thread.current.object_id.to_s(36)}#{context} #{severity}: #{}\n" end |
#context ⇒ Object
21 22 23 24 |
# File 'lib/taskinator/logger.rb', line 21 def context ctx = Thread.current[:taskinator_context] ctx ? " #{ctx}" : '' end |