Class: Usps::Imis::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/usps/imis/logger.rb

Overview

Formatted logger with additional helpers

Instance Method Summary collapse

Constructor Details

#initializeLogger

Returns a new instance of Logger.



10
11
12
13
# File 'lib/usps/imis/logger.rb', line 10

def initialize(...)
  super
  self.formatter = LoggerFormatter.new
end

Instance Method Details

#json(data) ⇒ Object



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

def json(data)
  tagged('JSON') { multiline(JSON.pretty_generate(data)) }
end

#multiline(string) ⇒ Object



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

def multiline(string)
  string.split("\n").each { |line| debug(line) }
end