Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #35762 > unrolled thread

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

Started byMorten Engvoldsen <mortenengv@gmail.com>
First post2012-12-29 19:38 +0100
Last post2012-12-29 19:38 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Facing issue with Python loggin logger for printing object value Morten Engvoldsen <mortenengv@gmail.com> - 2012-12-29 19:38 +0100

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

FromMorten Engvoldsen <mortenengv@gmail.com>
Date2012-12-29 19:38 +0100
SubjectRe: Facing issue with Python loggin logger for printing object value
Message-ID<mailman.1435.1356806290.29569.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

Hi Dev,
Thanks a lot Dev for your reply. It is really a great help.  Yes i have
fixed what was wrong in the create method like log.debug. I have declared
line_counter=1 before the for loop.  i will try now to chcek the value of
payment_line.

Thanks again a lot. I am greateful be a member of this forum :)

On Sat, Dec 29, 2012 at 6:10 PM, Dave Angel <d@davea.name> wrote:

> On 12/29/2012 11:54 AM, Morten Engvoldsen wrote:
> > 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.
>
> The closest thing Python has to "null value" is called None.  If
> payment_line is None, then you'll get an exception on that loop.
>
> As I said a while ago, I have no idea how openerp handles exceptions.
> Maybe it's just doing a bare except, and ignoring anything that goes
> wrong in your functions.  (Very bad practice)
>
> It could be that payment_line is an empty list.  In that case, the loop
> will execute zero times.  That would also explain the lack of output.
>
> So if openerp gives you no debugging aid, then you may have to fake it
> with the logger.  How about logging a simple message just before the loop?
>
> logger.debug("value of payment_line is " + repr(payment_line))
>
> Did you ever fix the other things wrong with that create method?  Like
> using log.debug when the object was called logger?  Or incrementing
> line_counter when there was no such variable, and when it would vanish
> when you exited the method anyway?
>
>
>
> --
>
> DaveA
>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web