Class: Wurk::Logger::Formatters::JSON
- Defined in:
- lib/wurk/logger.rb
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#call(severity, time, _program_name, message) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/wurk/logger.rb', line 55 def call(severity, time, _program_name, ) hash = { ts: time.utc.iso8601(3), pid: ::Process.pid, tid: tid, lvl: severity, msg: } ctx = Wurk::Context.current hash[:ctx] = ctx unless ctx.empty? "#{::JSON.generate(hash)}\n" end |