Skip to content

Instantly share code, notes, and snippets.

@andyzhuangyy
Created May 5, 2016 16:22
Show Gist options
  • Save andyzhuangyy/7739a09f296cf4c5c47f588cd0265fdf to your computer and use it in GitHub Desktop.
Save andyzhuangyy/7739a09f296cf4c5c47f588cd0265fdf to your computer and use it in GitHub Desktop.
decorator of log
def log_start(logger):
"""
Debug functions
"""
def decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
logger.debug('Calling: %s with: args: %s, kwargs:%s' %
(func.__name__, args, kwargs))
return func(*args, **kwargs)
return wrapper
return decorator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment