#NEWLINE# def logtime( func ) : #NEWLINE# #INDENT# @ functools . wraps ( func ) #NEWLINE# def wrapped( * args , **kwargs ) : #NEWLINE# #INDENT# if ( func . __class__ . __name__ == 'function' ) : #NEWLINE# #INDENT# executing = ( '%s.%s' % ( func . __module__ , func . __name__ ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'method' in func . __class__ . __name__ ) : #NEWLINE# #INDENT# executing = ( '%s.%s.%s' % ( func . __module__ , func . __class__ . __name__ , func . __name__ ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# executing = str ( func ) #NEWLINE# #UNINDENT# #UNINDENT# log . debug ( ( 'Logging execution time for %s with args: %s; kwargs: %s' % ( executing , args , kwargs ) ) ) #NEWLINE# start = time . time ( ) #NEWLINE# res = func ( * args , ** kwargs ) #NEWLINE# duration = ( time . time ( ) - start ) #NEWLINE# log . debug ( ( 'Called %s... duration: %s seconds' % ( executing , duration ) ) ) #NEWLINE# return res #NEWLINE# #UNINDENT# return wrapped