def _log_call_info(func, args, kwargs): # This is a separate function because I didn't want to repeat it the code in # both log_function_call and log_function_call_without_return. # TODO: clean up this line log.debug('Calling: %s (module %s), args: %s, kwargs: %s.' % (func.__name__, func.__module__, str(_get_cleaned_args(args)), str(_get_cleaned_args(kwargs))))
def _log_call_info(func, args, kwargs): # This is a separate function because I didn't want to repeat it the code in # both log_function_call and log_function_call_without_return. # TODO: clean up this line log.debug('Calling: %s (module %s), args: %s, kwargs: %s.' % (func.__name__, func.__module__, str( _get_cleaned_args(args)), str(_get_cleaned_args(kwargs))))
def do_logging_func_call(*args, **kwargs): _log_call_info(func, args, kwargs) starttime = datetime.datetime.now() try: result = func(*args, **kwargs) log.debug('Returning from %s (module %s) (time %s): %s' % (func.__name__, func.__module__, _get_timedelta_str(starttime), str(result))) return result except Exception, e: log.debug('Exception from %s (module %s): %s %s' % (func.__name__, func.__module__, type(e), str(e))) raise
def do_logging_func_call(*args, **kwargs): log.debug('Calling: %s (module %s), 1st arg: [Not logging], other args: %s, kwargs: %s.' % (func.__name__, func.__module__, str(_get_cleaned_args(args)[1:]), str(_get_cleaned_args(kwargs)))) starttime = datetime.datetime.now() try: result = func(*args, **kwargs) log.debug('Returning from %s (module %s) (time %s): %s' % (func.__name__, func.__module__, _get_timedelta_str(starttime), str(result))) return result except Exception, e: log.debug('Exception from %s (module %s): %s %s' % (func.__name__, func.__module__, type(e), str(e))) raise
def do_logging_func_call(*args, **kwargs): log.debug( 'Calling: %s (module %s), 1st arg: [Not logging], other args: %s, kwargs: %s.' % (func.__name__, func.__module__, str( _get_cleaned_args(args)[1:]), str(_get_cleaned_args(kwargs)))) starttime = datetime.datetime.now() try: result = func(*args, **kwargs) log.debug('Returning from %s (module %s) (time %s): %s' % (func.__name__, func.__module__, _get_timedelta_str(starttime), str(result))) return result except Exception, e: log.debug('Exception from %s (module %s): %s %s' % (func.__name__, func.__module__, type(e), str(e))) raise