Class: Usps::Imis::Logger
- Inherits:
-
Logger
- Object
- Logger
- Usps::Imis::Logger
- Defined in:
- lib/usps/imis/logger.rb
Overview
Formatted logger with additional helpers
Instance Method Summary collapse
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #json(data) ⇒ Object
- #multiline(string) ⇒ Object
Constructor Details
#initialize ⇒ Logger
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 |