Class: Triglav::Agent::LogFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/triglav/agent/logger.rb

Constant Summary

FORMAT =
"%s [%s] %s %s\n"

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ LogFormatter

Returns a new instance of LogFormatter



24
25
# File 'lib/triglav/agent/logger.rb', line 24

def initialize(opts={})
end

Instance Method Details

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



27
28
29
# File 'lib/triglav/agent/logger.rb', line 27

def call(severity, time, progname, msg)
  FORMAT % [format_datetime(time), severity, format_pid, format_message(msg)]
end