summaryrefslogtreecommitdiff
path: root/lib/oxidized/log.rb
blob: 9e7764691d20dd959b95310a49b215ce5204f5fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Oxidized

  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

end