mirror of
https://github.com/inspec/inspec
synced 2024-12-04 18:39:43 +00:00
659b4b373a
Signed-off-by: Miah Johnson <miah@chia-pet.org>
17 lines
332 B
Ruby
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
|