Class: PactBroker::Logging::DefaultFormatter

Inherits:
SemanticLogger::Formatters::Default
  • Object
show all
Defined in:
lib/pact_broker/logging/default_formatter.rb

Instance Method Summary collapse

Constructor Details

#initializeDefaultFormatter

Returns a new instance of DefaultFormatter.



7
8
9
# File 'lib/pact_broker/logging/default_formatter.rb', line 7

def initialize
  @formatter = ::Logger::Formatter.new
end

Instance Method Details

#call(log, _output) ⇒ Object



11
12
13
14
15
# File 'lib/pact_broker/logging/default_formatter.rb', line 11

def call(log, _output)
  self.log    = log
  self.logger = logger
  @formatter.call(log.level.upcase, log.time, nil, [tags, named_tags, duration, message, payload, exception].compact.join(" "))
end