Class: Brogger::TimestampFormatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/brogger/timestamp_formatter.rb

Instance Method Summary collapse

Instance Method Details

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



4
5
6
# File 'lib/brogger/timestamp_formatter.rb', line 4

def call(severity, time, progname, msg)
  format % [ time.utc.iso8601, progname, $$, severity, msg2str(msg) ]
end

#formatObject



9
10
11
# File 'lib/brogger/timestamp_formatter.rb', line 9

def format
  "%s [%s.%d] %5s: %s\n"
end

#msg2strObject



14
15
16
# File 'lib/brogger/timestamp_formatter.rb', line 14

def msg2str(*)
  super.strip
end