Class: Proselytism::Logger::Formatter

Inherits:
Object
  • Object
show all
Defined in:
lib/proselytism/logger.rb

Instance Method Summary collapse

Instance Method Details

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



5
6
7
8
# File 'lib/proselytism/logger.rb', line 5

def call(severity, time, progname, msg)
  formatted_time = time.strftime("%Y-%m-%d %H:%M:%S.") << time.usec.to_s[0..2].rjust(3)
  "#{formatted_time} [#{severity}][pid:#{$$}] #{msg.strip}\n"
end