mirror of
https://github.com/inspec/inspec
synced 2024-12-12 14:22:38 +00:00
4b9acb4800
* Bump Rubocop to 0.49.1 This change bumps Rubocop to 0.49.1. There have been a lot of changes since 0.39.0 and this PR is hopefully a nice compromise of turning off certain cops and updating our codebase to take advantage of new Ruby 2.3 methods and operators. Signed-off-by: Adam Leff <adam@leff.co> * Set end-of-line format to line-feed only, avoid Windows-related CRLF issues Signed-off-by: Adam Leff <adam@leff.co>
18 lines
350 B
Ruby
18 lines
350 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
|