diff options
-rw-r--r-- | lib/ohai/log.rb | 8 | ||||
-rw-r--r-- | lib/ohai/system.rb | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/ohai/log.rb b/lib/ohai/log.rb index c63f7abe..284d4fb0 100644 --- a/lib/ohai/log.rb +++ b/lib/ohai/log.rb @@ -25,5 +25,13 @@ module Ohai init(STDERR) level = :info + def self.configured? + @configured + end + + def self.use_log_devices(other) + @configured = true + super + end end end diff --git a/lib/ohai/system.rb b/lib/ohai/system.rb index cc332164..17642814 100644 --- a/lib/ohai/system.rb +++ b/lib/ohai/system.rb @@ -220,6 +220,8 @@ module Ohai end def configure_logging + return if Ohai::Log.configured? + Ohai::Log.init(Ohai.config[:log_location]) if Ohai.config[:log_level] == :auto |