diff options
author | Benjamin Black <bb@joyeuse.local> | 2009-02-26 17:22:18 -0800 |
---|---|---|
committer | Benjamin Black <bb@joyeuse.local> | 2009-02-26 17:22:18 -0800 |
commit | e43e36709a65c441103ba8af73bead8ba76ce61c (patch) | |
tree | 41c2dbf664185ed0c6918a9b7f1c94cdf0bc4e55 /bin | |
parent | 1f8fe1dae97a2e459800d9b9753d4a37283fa2a9 (diff) | |
download | ohai-e43e36709a65c441103ba8af73bead8ba76ce61c.tar.gz |
[OHAI-57] changed to match syntax of chef and removed extraneous logging
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ohai | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -27,7 +27,8 @@ require 'json' config = { :directory => nil, - :file => nil + :file => nil, + :log_level => :info } with_debug = false @@ -39,8 +40,8 @@ opts = OptionParser.new do |opts| opts.on("-f", "--file NAME", "A file to run Ohai against") do |f| config[:file] = f end - opts.on("-g", "--debug", "Turn on (extremely verbose) debugging") do |f| - with_debug = true + opts.on("-l", "--loglevel NAME", "Set log level for Ohai") do |l| + config[:log_level] = l end opts.on_tail("-h", "--help", "Show this message") do puts opts @@ -50,8 +51,9 @@ end opts.parse!(ARGV) ohai = Ohai::System.new -if with_debug - Ohai::Config[:log_level] = :debug + +if %( debug info warn error fatal ).include?(config[:log_level]) + Ohai::Config[:log_level] = config[:log_level].to_sym end if config[:file] ohai.from_file(config[:file]) |