From: "Stephan Kämper" Date: 2003-08-29T04:35:57+09:00 Subject: Log4r with Ruby 1.8 Hi all, I'm trying to use log4r ( http://log4r.sourceforge.net/contact.html ) but when running the example given at the site, I get an error (and I would like to know what I could do about it) The example is like so (from the abovementioned web page): > require 'log4r' > include Log4r > > # create a logger named 'mylog' that logs to stdout > mylog = Logger.new 'mylog' > mylog.outputters = Outputter.stdout > > # Now we can log. > def do_log(log) > log.debug "This is a message with level DEBUG" > log.info "This is a message with level INFO" > log.warn "This is a message with level WARN" > log.error "This is a message with level ERROR" > log.fatal "This is a message with level FATAL" > end > do_log(mylog) Now, the should be this: > DEBUG mylog: This is a message with level DEBUG > INFO mylog: This is a message with level INFO > WARN mylog: This is a message with level WARN > ERROR mylog: This is a message with level ERROR > FATAL mylog: This is a message with level FATAL ....but I get that: C:/RUBY/lib/ruby/site_ruby/1.8/log4r/formatter/formatter.rb:58:in `sprintf': unnumbered(1) mixed with numbered (ArgumentError) from C:/RUBY/lib/ruby/site_ruby/1.8/log4r/formatter/formatter.rb:58:in `format' from C:/RUBY/lib/ruby/site_ruby/1.8/log4r/outputter/outputter.rb:118:in `format' from C:/RUBY/lib/ruby/site_ruby/1.8/log4r/outputter/outputter.rb:108:in `canonical_log' from C:/RUBY/lib/ruby/site_ruby/1.8/log4r/outputter/outputter.rb:108:in `synch' from C:/RUBY/lib/ruby/site_ruby/1.8/log4r/outputter/outputter.rb:128:in `synchronize' from C:/RUBY/lib/ruby/site_ruby/1.8/log4r/outputter/outputter.rb:128:in `synch' from C:/RUBY/lib/ruby/site_ruby/1.8/log4r/outputter/outputter.rb:108:in `canonical_log' from (eval):3:in `debug' from (eval):8:in `debug' from (eval):8:in `each' from (eval):8:in `debug' from C:/Stephan/Programmierung/WegwerfSkripte/log4r.rb:12:in `do_log' from C:/Stephan/Programmierung/WegwerfSkripte/log4r.rb:18 Now I admit I'm quite not used to using sprintf... Any ideas? Cheers Stephan