Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > net/ssh makes log4r fail

Thread Tools

net/ssh makes log4r fail

Manish Sapariya
Posts: n/a
HI all,
For following code snippet, I get following error

$ ruby log4rtest.rb
`outputters=': undefined method `clear' for nil:NilClass (NoMethodError)
from ax.rb:7

I get similar error on windows, thought not exactly same.
D:\Temp>ruby log4rtest.rb
log4rtest.rb:10: undefined method `outputters=' for #<Logger:0x2d46e88>

However, If I remove require 'net/ssh', the error goes away.
I am not sure in what way requiring net/ssh affect log4r

Any ideas.

require 'rubygems'
require 'log4r'
include Log4r
require 'net/ssh'

$logger = 'log4GS_Host'
$logger.outputters = Outputter.stdout

# Now we can log.
def do_log(log)
$logger.debug "This is a message with level DEBUG"

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timeout makes report fail Morten Snedker ASP .Net 2 02-01-2007 06:44 AM
qr makes pattern match fail it_says_BALLS_on_your forehead Perl Misc 4 08-17-2006 07:50 PM
[ANN] Log4r 1.0.4 and update on adopting log4r Leon Torres Ruby 1 09-03-2003 08:10 PM
Log4r and Ruby 1.8.0 in Singleton problems David Heinemeier Hansson Ruby 0 08-05-2003 10:17 AM
if (f() != FAIL) or if (FAIL != f())? Wenjie C Programming 3 07-31-2003 09:54 PM