Class: GrapeLogging::Formatters::Rails
- Inherits:
-
Object
- Object
- GrapeLogging::Formatters::Rails
- Defined in:
- lib/grape_logging/formatters/rails.rb
Instance Method Summary collapse
Instance Method Details
#call(severity, datetime, _, data) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/grape_logging/formatters/rails.rb', line 7 def call(severity, datetime, _, data) if data.is_a?(String) "#{severity[0..0]} [#{datetime}] #{severity} -- : #{data}\n" elsif data.is_a?(Exception) "#{severity[0..0]} [#{datetime}] #{severity} -- : #{format_exception(data)}\n" elsif data.is_a?(Hash) format_hash(data) else "#{data.inspect}\n" end end |