Module: R7Insight::Host::InstanceMethods

Included in:
CONNECTION
Defined in:
lib/r7_insight/host.rb

Overview

Log formatter

Instance Method Summary collapse

Instance Method Details

#format_message(message_in, severity) ⇒ Object



21
22
23
24
25
# File 'lib/r7_insight/host.rb', line 21

def format_message(message_in, severity)
  message_in = message_in.inspect unless message_in.is_a?(String)

  "severity=#{severity}, #{message_in.lstrip}"
end

#formatterObject



15
16
17
18
19
# File 'lib/r7_insight/host.rb', line 15

def formatter
  proc do |severity, datetime, _, msg|
    "#{datetime} #{format_message(msg, severity)}"
  end
end