Class: Logger::JSONFormatter

Inherits:
Formatter
  • Object
show all
Defined in:
lib/inspec/utils/json_log.rb

Overview

a simple streaming json logger

Instance Method Summary collapse

Instance Method Details

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



5
6
7
8
9
10
11
12
13
14
# File 'lib/inspec/utils/json_log.rb', line 5

def call(severity, time, progname, msg)
  puts JSON.generate(
    {
      "progname" => progname,
      "severity" => severity,
      "time" => time,
      "msg" => msg,
    }
  )
end