summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/oxidized/config/core.rb2
-rw-r--r--lib/oxidized/log.rb26
-rw-r--r--oxidized.gemspec2
3 files changed, 19 insertions, 11 deletions
diff --git a/lib/oxidized/config/core.rb b/lib/oxidized/config/core.rb
index ec08dab..59ada3a 100644
--- a/lib/oxidized/config/core.rb
+++ b/lib/oxidized/config/core.rb
@@ -28,6 +28,6 @@ module Oxidized
CFG = Config.new
CFG.defaults
CFG.load
- Log.file = CFG.log if CFG.log
Log.level = Logger::INFO unless CFG.debug
+ Log.file = CFG.log if CFG.log
end
diff --git a/lib/oxidized/log.rb b/lib/oxidized/log.rb
index db39462..9e77646 100644
--- a/lib/oxidized/log.rb
+++ b/lib/oxidized/log.rb
@@ -1,13 +1,21 @@
module Oxidized
- require 'logger'
- class Logger < Logger
- def initialize target=STDOUT
- super target
- self.level = Logger::DEBUG
- end
- def file= target
- @logdev = LogDevice.new target
+
+ begin
+ require 'syslog/logger'
+ Log = Syslog::Logger.new 'oxidized'
+ Log.define_singleton_method(:file=){|arg|}
+ rescue LoadError
+ # 1.9.3 has no love for syslog
+ require 'logger'
+ class Logger < Logger
+ def initialize target=STDOUT
+ super target
+ end
+ def file= target
+ @logdev = LogDevice.new target
+ end
end
+ Log = Logger.new
end
- Log = Logger.new
+
end
diff --git a/oxidized.gemspec b/oxidized.gemspec
index 23a44b0..62c709f 100644
--- a/oxidized.gemspec
+++ b/oxidized.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'oxidized'
- s.version = '0.0.26'
+ s.version = '0.0.27'
s.platform = Gem::Platform::RUBY
s.authors = [ 'Saku Ytti' ]
s.email = %w( saku@ytti.fi )