net/ssh makes log4r fail

Discussion in 'Ruby' started by Manish Sapariya, Oct 19, 2007.

  1. HI all,
    For following code snippet, I get following error

    $ ruby log4rtest.rb
    /usr/lib/ruby/gems/1.8/gems/log4r-1.0.5/src/log4r/logger.rb:109:in
    `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>
    (NoMethodError)

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

    Any ideas.
    Thanks,
    Manish

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

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


    # Now we can log.
    def do_log(log)
    $logger.debug "This is a message with level DEBUG"
    end
    do_log($logger)
    ===============
     
    Manish Sapariya, Oct 19, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Morten Snedker

    Timeout makes report fail

    Morten Snedker, Jan 31, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    586
    Morten Snedker
    Feb 1, 2007
  2. Leon Torres
    Replies:
    1
    Views:
    127
    Leon Torres
    Sep 3, 2003
  3. Tench Johnson
    Replies:
    1
    Views:
    298
    Biff Tannen
    Apr 23, 2010
  4. salamond

    net/ssh in ruby. ssh.exec fails

    salamond, Feb 17, 2011, in forum: Ruby
    Replies:
    0
    Views:
    248
    salamond
    Feb 17, 2011
  5. it_says_BALLS_on_your forehead

    qr makes pattern match fail

    it_says_BALLS_on_your forehead, Aug 17, 2006, in forum: Perl Misc
    Replies:
    4
    Views:
    125
    it_says_BALLS_on_your forehead
    Aug 17, 2006
Loading...

Share This Page