Class: LogjamAgent::ConsoleFormatter
- Inherits:
-
Logger::Formatter
- Object
- Logger::Formatter
- LogjamAgent::ConsoleFormatter
- Defined in:
- lib/logjam_agent/buffered_logger.rb
Instance Method Summary collapse
-
#call(severity, timestamp, progname, msg) ⇒ Object
This method is invoked when a log event occurs.
- #format_time(timestamp) ⇒ Object
Instance Method Details
#call(severity, timestamp, progname, msg) ⇒ Object
This method is invoked when a log event occurs
7 8 9 |
# File 'lib/logjam_agent/buffered_logger.rb', line 7 def call(severity, , progname, msg) "[#{format_time()}] #{String === msg ? msg : msg.inspect}\n" end |
#format_time(timestamp) ⇒ Object
11 12 13 |
# File 'lib/logjam_agent/buffered_logger.rb', line 11 def format_time() .strftime("%H:%M:%S.#{"%06d" % .usec}") end |