Source line number for log purpose (newbie)

T. C. Mits 71351.356 at compuserve.com
Sat Sep 25 00:20:37 EDT 1999


In c there was a way to get the current source line number via a macro,
__LINE__.

I need to be able to do the same thing.  I created a logger class that uses
a level setting.  At high levels I want to
log the source line number where the inline log.prtl( level, msg) method
call appears.

I'm sure this is easy but am getting lost digging through the Python source
and docs.

Thanks.....







More information about the Python-list mailing list