Re: Facing issue with Python loggin logger for printing object value

Discussion in 'Python' started by Morten Engvoldsen, Dec 29, 2012.

  1. Hi Dave,
    Thanks a lot for your reply. I have used logging.setLevel(logger.DEBUG)
    because of threshold as you said.

    I didn't copy paste the entire program since it was very huge. The "batch "
    which value i am trying to retrieve is in a a for loop :

    for payment in payment_line:

    but here payment_line has null value since it was not able to retrieve
    payment line value from the payment object. So i would like to know if
    payment_line has null value, will it be enter into for loop since i was
    able to log message which is before the for loop but the message inside
    the for loop i am not able to log.

    Thanks again... :)

    On Sat, Dec 29, 2012 at 5:41 PM, Dave Angel <> wrote:

    > On 12/29/2012 07:39 AM, Morten Engvoldsen wrote:
    > > Hi Dave,
    > > Thanks for reply. I will really appreciate if you reply to my mail id and
    > > keep python list in cc, since everytime you reply my query i need to

    > search
    > > the reply in the forwarding message of python list.

    >
    > I won't be able to remember to special-case your account, but maybe for
    > the next few days. Far too many others have complained when they get an
    > email directly, either by sending me a request message, by using an
    > address at the "invalid" domain, by hijacking some bogus email address,
    > or by having an autoreply that says "Please don't try to contact me at
    > this address". For a while I considered adding all such people to a
    > kill-file, but decided I'd miss too much.
    >
    > I suggest you get used to reading all messages, or to simply following
    > the thread. (For example, Thunderbird can keep all messages together
    > which are replies to each other) And while I've got you, it'd be nice if
    > you used reply-list yourself, instead of starting a new thread each time.
    >
    > >
    > > Using logger.setLevel(logging.DEBUG) will log only debug message in the

    > log
    > > file and discard other message from log file. So that's not solving the
    > > issue of my problem. I am looking into code to find out the issue.
    > >

    >
    > That's not what setLevel() does. It's a >= comparison, not an == one.
    > http://docs.python.org/2/library/logging
    > """Logger.setLevel(lvl)
    > Sets the threshold for this logger to lvl. Logging messages which are
    > less severe than lvl will be ignored."""
    >
    > Perhaps you should also read the page:
    > http://docs.python.org/dev/howto/logging
    > search for the phrase " increasing order of severity" where it lists the
    > 5 levels, in order. The default level for the root logger is WARNING,
    > so it ignores DEBUG and INFO messages. I suggested changing it to
    > DEBUG, so those won't get ignored.
    >
    > You probably need to write a 10-line self-contained program to
    > experiment with this, and run it outside of openerp. Chances are
    > openerp is doing something special that you need to conform to. But I'm
    > not going to be able to guess that.
    >
    >
    >
    > --
    >
    > DaveA
    >
     
    Morten Engvoldsen, Dec 29, 2012
    #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 Engvoldsen
    Replies:
    0
    Views:
    127
    Morten Engvoldsen
    Dec 28, 2012
  2. Dave Angel
    Replies:
    0
    Views:
    140
    Dave Angel
    Dec 28, 2012
  3. Dave Angel
    Replies:
    0
    Views:
    134
    Dave Angel
    Dec 28, 2012
  4. Morten Engvoldsen
    Replies:
    0
    Views:
    126
    Morten Engvoldsen
    Dec 29, 2012
  5. Chris Angelico
    Replies:
    0
    Views:
    137
    Chris Angelico
    Dec 29, 2012
Loading...

Share This Page