inspec/lib/utils/json_log.rb
Miah Johnson 659b4b373a Remove # encoding: utf8 magic comments
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-07 16:06:23 -07:00

17 lines
332 B
Ruby

# author: Christoph Hartmann
require 'json'
# a simple streaming json logger
class Logger::JSONFormatter < Logger::Formatter
def call(severity, time, progname, msg)
puts JSON.generate(
{
'progname'=> progname,
'severity'=> severity,
'time'=> time,
'msg'=> msg,
},
)
end
end