Class: Sidekiq::Logger::Formatters::Base
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Sidekiq::Logger::Formatters::Base
- Defined in:
- lib/sidekiq/logger.rb
Instance Method Summary collapse
Instance Method Details
#ctx ⇒ Object
118 119 120 |
# File 'lib/sidekiq/logger.rb', line 118 def ctx Sidekiq::Context.current end |
#format_context ⇒ Object
122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/sidekiq/logger.rb', line 122 def format_context if ctx.any? " " + ctx.compact.map { |k, v| case v when Array "#{k}=#{v.join(",")}" else "#{k}=#{v}" end }.join(" ") end end |
#tid ⇒ Object
114 115 116 |
# File 'lib/sidekiq/logger.rb', line 114 def tid Thread.current["sidekiq_tid"] ||= (Thread.current.object_id ^ ::Process.pid).to_s(36) end |