Class: Fatty::Logger::TextFormatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/fatty/log_formats/text.rb

Instance Method Summary collapse

Instance Method Details

#call(level, time, progname, msg) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/fatty/log_formats/text.rb', line 29

def call(level, time, progname, msg)
  ts = time.utc.iso8601(6)

  body =
    case msg
    when Hash
      render_hash(msg)
    else
      msg.to_s
    end

  "#{ts} #{level} #{progname} #{body}\n"
end