Пример #1
0
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))))
Пример #2
0
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))))
Пример #3
0
 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
Пример #4
0
    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
Пример #5
0
 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
Пример #6
0
    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