Traceback in Logging

Thorsten Kampe thorsten at thorstenkampe.de
Tue Jan 6 17:19:51 EST 2009


* Vinay Sajip (Tue, 6 Jan 2009 11:24:54 -0800 (PST))
> On Jan 6, 4:17 pm, Kottiyath <n.kottiy... at gmail.com> wrote:
> > I dont want the whole traceback. I just wanted to know where the log
> > was generated from i.e. which procedure and which line. I have 3/4
> > points in many procedures where I encounter a small error (not an
> > exception) and want to log it. So having individual names for each
> > looks to be somewhat verbose - esp since the application is >10K LOC.
> >
> 
> Don't the funcName and lineno arguments in the format string work for
> you?
> 
> (See http://docs.python.org/library/logging.html#id1)

I don't think he's interested in the "line number where the logging call 
was issued" but where the exception occurred.

Thorsten



More information about the Python-list mailing list