Project

General

Profile

« Previous | Next » 

Revision 85fba042

Added by Benjamin Dauvergne over 11 years ago

logging: add a decorator to log timing of functions or methods

Use it like that:

from entrouvert.logging.decorators import timing
@timing(0, 1, logger='timing')
def method(arg0, arg1):
etc...
return arg0
It will output lines to the logger named 'timing' at the DEBUG level::
DEBUG module.method args: [arg0,arg1] entry: 23232.23232323
DEBUG module.method args: [arg0,arg1] exit: 232334.23232323 duration: 232.2323
  • added
  • modified
  • copied
  • renamed
  • deleted