From: Lars Mai Date: 2012-03-30T21:39:14+09:00 Subject: Re: ruby-net-nntp usage THUFIR H. wrote in post #1053580: > Thanks, I looked at the source, and installed log4r, and looked at their > webpage as well. I've tried variations, but get: > > thufir@dur:~/ruby/nntp$ > thufir@dur:~/ruby/nntp$ nl nntp.rb > 1 require 'rubygems' > 2 require 'net/nntp' > > 3 nntp = Net::NNTP.new > 4 Net::NNTP.logger = Logger.new > 5 welcome = nntp.connect > thufir@dur:~/ruby/nntp$ > thufir@dur:~/ruby/nntp$ ruby nntp.rb > /home/thufir/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/ > rubygems/custom_require.rb:36:in `require': iconv will be deprecated in > the future, use String#encode instead. > nntp.rb:5:in `
': uninitialized constant Logger (NameError) Oops. Just in case you haven't figured it out yourself by now: you need to initialize the log4r logger with the full namespace, like this: Net::NNTP.logger = Log4r::Logger.new 'mylog' HTH, - Lars -- Posted via http://www.ruby-forum.com/.