Recipes for trace statements inside python programs?

Francesco Bochicchio bieffe62 at gmail.com
Thu Jun 25 10:40:01 CEST 2009


Sorry, hit the send button by mistake ...
The definition of the trace function should be like:

if __debug__ :
   def TRACE(*args):
     if  trace_enabled(): print "TRACE(%s) : %s " % ( context(),
                              " ".join( str(x) for x in args ) )
else : # optimazed code, only a function call performance penalty
   def TRACE(*args): pass


If I don't find anything suitable, maybe I will bake my own again,
this
time aiming to something that I can reuse ...

Ciao and thanks for any tip/suggestion
------
FB



More information about the Python-list mailing list