summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBenjamin Black <bb@joyeuse.local>2009-02-26 17:22:18 -0800
committerBenjamin Black <bb@joyeuse.local>2009-02-26 17:22:18 -0800
commite43e36709a65c441103ba8af73bead8ba76ce61c (patch)
tree41c2dbf664185ed0c6918a9b7f1c94cdf0bc4e55 /bin
parent1f8fe1dae97a2e459800d9b9753d4a37283fa2a9 (diff)
downloadohai-e43e36709a65c441103ba8af73bead8ba76ce61c.tar.gz
[OHAI-57] changed to match syntax of chef and removed extraneous logging
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ohai12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/ohai b/bin/ohai
index 69f69ff1..41a292cd 100755
--- a/bin/ohai
+++ b/bin/ohai
@@ -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])