Class: Pigeon::Logger
- Inherits:
-
Logger
- Object
- Logger
- Pigeon::Logger
- Defined in:
- lib/pigeon/logger.rb
Instance Method Summary collapse
-
#format_message(severity, datetime, progname, msg) ⇒ Object
Over-rides the default log format.
-
#thread_id ⇒ Object
Returns a sequential thread identifier which is human readable and much more concise than internal numbering system used.
Instance Method Details
#format_message(severity, datetime, progname, msg) ⇒ Object
Over-rides the default log format.
12 13 14 |
# File 'lib/pigeon/logger.rb', line 12 def (severity, datetime, progname, msg) "[%s %6d] %s\n" % [ datetime.strftime("%Y-%m-%d %H:%M:%S"), thread_id, msg ] end |
#thread_id ⇒ Object
Returns a sequential thread identifier which is human readable and much more concise than internal numbering system used.
6 7 8 9 |
# File 'lib/pigeon/logger.rb', line 6 def thread_id @threads ||= { } @threads[Thread.current.object_id] ||= @threads.length end |