Class: Wurk::Logger::Formatters::Base
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- Wurk::Logger::Formatters::Base
- Defined in:
- lib/wurk/logger.rb
Constant Summary collapse
- SEVERITY_COLORS =
{ 'DEBUG' => "\e[1;32mDEBUG\e[0m", 'INFO' => "\e[1;34mINFO \e[0m", 'WARN' => "\e[1;33mWARN \e[0m", 'ERROR' => "\e[1;31mERROR\e[0m", 'FATAL' => "\e[1;35mFATAL\e[0m" }.freeze
Instance Method Summary collapse
Instance Method Details
#format_context(ctxt = Wurk::Context.current) ⇒ Object
34 35 36 37 38 |
# File 'lib/wurk/logger.rb', line 34 def format_context(ctxt = Wurk::Context.current) return '' if ctxt.empty? " #{ctxt.map { |k, v| v.is_a?(Array) ? "#{k}=#{v.join(',')}" : "#{k}=#{v}" }.join(' ')}" end |
#tid ⇒ Object
30 31 32 |
# File 'lib/wurk/logger.rb', line 30 def tid Thread.current[:wurk_tid] ||= (Thread.current.object_id ^ ::Process.pid).to_s(36) end |