Class: GeneValidatorApp::Logger::Formatter

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

Overview

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

Constant Summary collapse

Format =
"[%s] %s  %s\n".freeze

Instance Method Summary collapse

Constructor Details

#initializeFormatter

Returns a new instance of Formatter.



15
16
17
# File 'lib/genevalidatorapp/logger.rb', line 15

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

Instance Method Details

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



19
20
21
# File 'lib/genevalidatorapp/logger.rb', line 19

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