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

Discussion in 'Python' started by Mitya Sirenef, Dec 29, 2012.

  1. On 12/29/2012 03:50 PM, Morten Engvoldsen wrote:
    > Hi Dave,
    > It is able to log the message with:
    > logger.debug("value of payment_line is " +repr(payment_line))
    >
    > The output is:
    > value of payment_line is []
    >
    > So it means payment_line is an empty list, so may be it could be

    reason it's not able to enter into the loop since the message in the for
    loop is not logged in the log file.
    >
    > Thanks and good night.. :)



    You can easily test how iteration over empty list works:


    >>> l=[]
    >>> for x in l: print(x)

    ....
    >>>


    i.e. nothing is printed because loop runs 0 times.


    -m



    --
    Lark's Tongue Guide to Python: http://lightbird.net/larks/
     
    Mitya Sirenef, 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:
    138
    Morten Engvoldsen
    Dec 28, 2012
  2. Dave Angel
    Replies:
    0
    Views:
    151
    Dave Angel
    Dec 28, 2012
  3. Dave Angel
    Replies:
    0
    Views:
    144
    Dave Angel
    Dec 28, 2012
  4. Morten Engvoldsen
    Replies:
    0
    Views:
    140
    Morten Engvoldsen
    Dec 29, 2012
  5. Chris Angelico
    Replies:
    0
    Views:
    151
    Chris Angelico
    Dec 29, 2012
Loading...

Share This Page