In C++, I can print debug output like this:
printf( \"FILE: %s, FUNC: %s, LINE: %d, LOG: %s\\n\", __FILE__, __FUNCTION__, __LINE__, logmessage
import inspect . . . def __LINE__(): try: raise Exception except: return sys.exc_info()[2].tb_frame.f_back.f_lineno def __FILE__(): return inspect.currentframe().f_code.co_filename . . . print "file: '%s', line: %d" % (__FILE__(), __LINE__())