Traceback in Logging

Vinay Sajip vinay_sajip at yahoo.co.uk
Tue Jan 6 20:24:54 CET 2009


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)

Regards,

Vinay Sajip



More information about the Python-list mailing list