Class: SequenceServer::Logger::Formatter

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

Overview

We change Logging format so that it is consistent with Sinatra's

Constant Summary collapse

FORMAT =
"[%s] %s  %s\n"

Instance Method Summary collapse

Constructor Details

#initializeFormatter

Returns a new instance of Formatter


16
17
18
# File 'lib/sequenceserver/logger.rb', line 16

def initialize
  self.datetime_format = '%Y-%m-%d %H:%M:%S'
end

Instance Method Details

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


20
21
22
# File 'lib/sequenceserver/logger.rb', line 20

def call(severity, time, _progname, msg)
  format FORMAT, format_datetime(time), severity, msg2str(msg)
end