mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
basic logging setup for inspec exec
This change tries hard to stay backward compatible: if you ask for JSON output, you will NOT get any logging. Fixes #349.
This commit is contained in:
parent
1f325b1cfd
commit
e1d5b2be92
1 changed files with 4 additions and 1 deletions
|
@ -107,7 +107,10 @@ class InspecCLI < Thor # rubocop:disable Metrics/ClassLength
|
|||
def exec(*tests)
|
||||
diagnose
|
||||
|
||||
runner = Inspec::Runner.new(opts)
|
||||
o = opts.dup
|
||||
o[:logger] = Logger.new(opts['format'] == 'json' ? nil : STDOUT)
|
||||
|
||||
runner = Inspec::Runner.new(o)
|
||||
runner.add_tests(tests)
|
||||
exit runner.run
|
||||
rescue RuntimeError => e
|
||||
|
|
Loading…
Reference in a new issue