示例#1
0
 def decorator_logging(f):
     def do_trace(*args, **named_args):
         # this if is just a optimization to avoid unecessary string formatting
         if logging.DEBUG >= logger.getEffectiveLevel():
             _trace_function_call(logger, f.__name__, *args, **named_args)
         return f(*args, **named_args)
     _interop._update_wrapper(do_trace, f)
     return do_trace
示例#2
0
 def decorator_logging(f):
     if not _enable_tracing:
         return f
     def do_trace(*args, **named_args):
         # this if is just a optimization to avoid unecessary string formatting
         if logging.DEBUG >= logger.getEffectiveLevel():
             fn = type(args[0]).__name__ + '.' + f.__name__
             _trace_function_call(logger, fn, *args[1:], **named_args)
         return f(*args, **named_args)
     _interop._update_wrapper(do_trace, f)
     return do_trace
示例#3
0
文件: _debug.py 项目: AeroEng43/pyusb
 def decorator_logging(f):
     if not _enable_tracing:
         return f
     def do_trace(*args, **named_args):
         # this if is just a optimization to avoid unecessary string formatting
         if logging.DEBUG >= logger.getEffectiveLevel():
             fn = type(args[0]).__name__ + '.' + f.__name__
             _trace_function_call(logger, fn, *args[1:], **named_args)
         return f(*args, **named_args)
     _interop._update_wrapper(do_trace, f)
     return do_trace