Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'value,': 0.03; 'messages.': 0.04; 'root': 0.04; 'subject:Python': 0.05; 'debug': 0.05; 'discard': 0.05; 'python': 0.09; '"': 0.09; '"please': 0.09; 'logger': 0.09; 'other)': 0.09; 'threshold': 0.09; 'cc:addr:python-list': 0.10; 'thread': 0.11; 'suggest': 0.11; 'dec': 0.15; 'sat,': 0.15; 'complained': 0.16; 'ignores': 0.16; 'levels,': 0.16; 'log.': 0.16; 'said.': 0.16; 'subject:issue': 0.16; 'subject:object': 0.16; 'thread.': 0.16; 'wrote:': 0.17; 'url:dev': 0.17; 'issue.': 0.20; 'suggested': 0.20; 'file.': 0.20; 'trying': 0.21; 'object.': 0.22; "i'd": 0.22; 'cc:2**0': 0.23; '>': 0.23; 'ignored.': 0.23; 'sets': 0.23; "i've": 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'skip:" 20': 0.26; 'am,': 0.27; 'guess': 0.27; 'logging': 0.27; 'order.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'reply.': 0.28; 'run': 0.28; '"please': 0.29; 'directly,': 0.29; 'skip:& 10': 0.29; 'probably': 0.29; "i'm": 0.29; 'maybe': 0.29; 'that.': 0.30; 'query': 0.30; 'skip:& 30': 0.30; 'lists': 0.31; 'code': 0.31; 'problem.': 0.32; 'url:python': 0.32; 'file': 0.32; 'info': 0.32; 'says': 0.33; 'messages,': 0.33; 'much.': 0.33; 'null': 0.33; 'received:google.com': 0.34; 'thanks': 0.34; 'list': 0.35; 'skip:l 30': 0.35; 'solving': 0.35; 'doing': 0.35; 'pm,': 0.35; "won't": 0.35; 'received:209.85': 0.35; 'something': 0.35; 'next': 0.35; 'list.': 0.35; 'really': 0.36; 'but': 0.36; 'url:org': 0.36; 'url:library': 0.36; "didn't": 0.36; 'subject:with': 0.36; 'should': 0.36; 'too': 0.36; 'level': 0.37; '(for': 0.37; 'received:209': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'url:docs': 0.38; 'instead': 0.39; 'where': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'address': 0.60; 'here': 0.65; 'decided': 0.65; 'reply': 0.66; 'contact': 0.68; 'special': 0.73; 'miss': 0.75; 'increasing': 0.75; 'yourself,': 0.75; 'address,': 0.79; 'domain,': 0.84; 'experiment': 0.84; "it'd": 0.84; 'subject:printing': 0.84; 'subject:value': 0.84; '\xa0but': 0.84; 'severe': 0.91; 'angel': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7+siojAHLILRn2O7tWHnQjmdINSKUkJhN6kZ7y9MOYs=; b=oUw9/IP+zxEld0O0lGTjIaxt/Sq0+vd1pEBxZ/U+oFzzvhINITDkXY7//HDQTkNWRx WZilWwtxwLqZOh6+b8wpgD5aA95tZaBx0cAmdbozS959UXIy1RNqBhszF+KWEa7/XKes n1cxhBlU8t6+UMawvJ3ekbT91C+ZLsGes/65yctzaGBqK71VJq+U3RmzMdFbV8v54bIj PxaQtI3WGpZlb1kbNhS0Lp7kKb/c4hwwUiHxd1q4hiDCDSiLaMKUDUDdDKEOHA/LxWTp /Xd58zxCOJeKXSv5nbMqu8NHHU/n2Zv6pS3VMcFdtOF7KGOCjdE0ei1MjbLUKiq4UWL4 L4kw== MIME-Version: 1.0 In-Reply-To: <50DF1D48.2060507@davea.name> References: <50DF1D48.2060507@davea.name> Date: Sat, 29 Dec 2012 17:54:33 +0100 Subject: Re: Facing issue with Python loggin logger for printing object value From: Morten Engvoldsen To: d@davea.name Content-Type: multipart/alternative; boundary=14dae9340dd56c24ec04d200a2ea Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 165 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356800081 news.xs4all.nl 6943 [2001:888:2000:d::a6]:47007 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35754 --14dae9340dd56c24ec04d200a2ea Content-Type: text/plain; charset=ISO-8859-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 > --14dae9340dd56c24ec04d200a2ea Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Dave,
Thanks a lot for your reply. I have used logging.se= tLevel(logger.DEBUG) because of threshold as you said.
=A0
<= div>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 :=
=A0
for payment in payment_line:
=A0
but= here payment_line has null value since it was not able to retrieve payment= line value=A0from the payment object. So i would like to know if payment_l= ine has null value, will it be enter into for loop since i was able to log = message=A0which is =A0before the for loop but the message inside the for lo= op i am not able to log.
=A0
Thanks again... :)

On Sat, Dec 29, 2012 at 5:41 PM, Dave Angel <d@davea.name> wr= ote:
On 12/29/2012 07:39 AM, Morten Engvoldse= n 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 s= earch
> the reply in the forwarding message of python list.

I won't be able to remember to special-case your account, but may= be for
the next few days. =A0Far too many others have complained when they get an<= br> email directly, either by sending me a request message, by using an
address at the "invalid" domain, by hijacking some bogus email ad= dress,
or by having an autoreply that says "Please don't try to contact m= e at
this address". =A0For 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. =A0(For example, Thunderbird can keep all messages together
which are replies to each other) And while I've got you, it'd be ni= ce 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 th= e log
> file and discard other message from log file. So that's not solvin= g the
> issue of my problem. I am looking into code to find out the issue.
>

That's not what setLevel() does. =A0It's a >=3D comparison= , not an =3D=3D one.
=A0 =A0 =A0http://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:
=A0 =A0 http://docs.python.org/dev/howto/logging
search for the phrase " increasing order of severity" where it li= sts the
5 levels, in order. =A0The default level for the root logger is WARNING, so it ignores DEBUG and INFO messages. =A0I 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. =A0Chances are
openerp is doing something special that you need to conform to. =A0But I= 9;m
not going to be able to guess that.



--

DaveA

--14dae9340dd56c24ec04d200a2ea--