Class: FormatterWithThread

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/mqrpc/logger.rb

Overview

Make logger include the thread id.

Constant Summary collapse

Format =
"%s, [%s#%d/%s] %5s -- %s: %s\n"

Instance Method Summary collapse

Instance Method Details

#call(severity, time, progname, msg) ⇒ Object



21
22
23
24
25
# File 'lib/mqrpc/logger.rb', line 21

def call(severity, time, progname, msg)
  thread_id = (Thread.current[:name] or Thread.current)
  Format % [severity[0..0], format_datetime(time), $$, thread_id,
            severity, progname, msg2str(msg)]
end