mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
18 lines
345 B
Ruby
18 lines
345 B
Ruby
|
# encoding: utf-8
|
||
|
# 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
|