Hi,
I've tried mailing the lead developer of log4r for this problems a couple of days ago, but got no reply so far. So I figured - why not try here?
The various problem I've seen with log4r ("out of the box"):
- 'error' and 'fatal' levels are undefined
- 'warn' level messages does not get formatted
- SyslogOutputter does not actually output anything
Here's a short test program demonstrating the problems:
···
---
#!/usr/local/bin/ruby
require 'log4r/outputter/syslogoutputter'
require 'log4r/outputter/outputter.rb'
include Log4r
at_exit { Outputter.each_outputter{ |o| o.flush } }
l = Logger.new('foo', ALL, true, true)
sl = SyslogOutputter.new('sl')
so = StdoutOutputter.new('stdout')
sl.level = so.level = l.level = ALL
l.add(sl, so)
%W{ debug info warn error fatal }.each { |lvl|
begin
l.send(lvl, 'test')
rescue => err
$stdout.puts "Error : #{err}"
end
}
---
.... and the corresponding output ...
---
DEBUG foo(./test.rb:19:in `send'): test
INFO foo(./test.rb:19:in `send'): test
test
Error : undefined method `error' for #<Log4r::Logger:0x812e11c>
Error : undefined method `fatal' for #<Log4r::Logger:0x812e11c>
---
Some details:
- Log4r 1.0.5 (installed via RubyGems)
- RUBYOPT=rubygems
- Ruby 1.8.2
- FreeBSD 5.4 (i386)
Anyone seen this before?
// Johan