[Celerity-users] silencing INFO messages

Ming minger at gmail.com
Thu Jan 28 16:51:31 EST 2010


*

I'm a new ruby coder, so I apologize for misunderstanding the source
code.  (The reader and writer accessors look different in scope, as
below.)  I was looking outside the constructor (and being stupid).

It is true that I call
browser.webclient.getCredentialsProvider.addProxyCredentials after the
browser is initialized, which as you say, probably resets the info
settings.

I'm running Celerity gem v 0.7.8.  I'd be willing to test changes from github.

http://github.com/jarib/celerity/blob/master/lib/celerity/browser.rb


    def log_level
      Celerity::Util.logger_for('com.gargoylesoftware.htmlunit').level.to_s.downcase.to_sym
    end

    #
    # Set Java log level (default is :warning, can be any of :all,
:finest, :finer, :fine, :config, :info, :warning, :severe, :off)
    #
    # @param [Symbol] level The new log level.
    #

    def log_level=(level)
      log_level = java.util.logging.Level.const_get(level.to_s.upcase)

      [ 'com.gargoylesoftware.htmlunit',
        'com.gargoylesoftware.htmlunit.html',
        'com.gargoylesoftware.htmlunit.javascript',
        'org.apache.commons.httpclient'
      ].each { |package| Celerity::Util.logger_for(package).level = log_level }

      level
    end

*
On Thu, Jan 28, 2010 at 4:18 PM, Jari Bakken <jari.bakken at gmail.com> wrote:

> On Thu, Jan 28, 2010 at 10:12 PM, Ming <minger at gmail.com> wrote:
> > to follow up on my own post, the setter and constructor setter for
> log_level
> > do different things.
> > the log_level= setter does more. to silence, one has to write
> >
> > browser.log_level = :off
> >
> > i don't know if this is intended but i would expect the setter to do the
> > same thing, inside or outside the constructor.
> >
>
> What version of Celerity are you using?
>
> The constructor calls the setter, so there shouldn't be any difference.
> I think what's happening is that the log level is set, then the proxy
> stuff is set up, which for some reason resets the log level. Then when
> you set it again afterwards, it's set for good.
>
> I'll try to change the order of things in the constructor. Would you
> be able to test if it works by checking out the code from GitHub?
>
> http://github.com/jarib/celerity
> _______________________________________________
> Celerity-users mailing list
> Celerity-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/celerity-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/celerity-users/attachments/20100128/3d0fbf4c/attachment-0001.html>


More information about the Celerity-users mailing list