Class: Shoryuken::Logging::Pretty

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/shoryuken/logging.rb

Instance Method Summary collapse

Instance Method Details

#call(severity, time, _program_name, message) ⇒ Object

Provide a call() method that returns the formatted message.



8
9
10
# File 'lib/shoryuken/logging.rb', line 8

def call(severity, time, _program_name, message)
  "#{time.utc.iso8601} #{Process.pid} TID-#{Thread.current.object_id.to_s(36)}#{context} #{severity}: #{message}\n"
end

#contextObject



12
13
14
15
# File 'lib/shoryuken/logging.rb', line 12

def context
  c = Thread.current[:shoryuken_context]
  c ? " #{c}" : ''
end