Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.albasani.net!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.nosignal.org!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'output': 0.04; 'subject:Python': 0.05; 'python:': 0.09; 'iteration': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'subject:issue': 0.16; 'subject:object': 0.16; 'wrote:': 0.17; 'skip:+ 20': 0.18; '>>>': 0.18; 'file.': 0.20; 'runs': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'i.e.': 0.27; 'could': 0.32; 'to:addr:python-list': 0.33; 'times.': 0.33; 'thanks': 0.34; 'list': 0.35; 'pm,': 0.35; 'subject:with': 0.36; 'test': 0.36; 'subject:: ': 0.38; 'nothing': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'easily': 0.39; 'list,': 0.39; 'received:192.168': 0.40; 'subject:printing': 0.84; 'subject:value': 0.84 Date: Sat, 29 Dec 2012 15:59:43 -0500 From: Mitya Sirenef User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121011 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Facing issue with Python loggin logger for printing object value References: <50DF1D48.2060507@davea.name> <50DF241B.5070007@davea.name> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356814788 news.xs4all.nl 6955 [2001:888:2000:d::a6]:60936 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35779 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/