Created
May 5, 2016 16:22
-
-
Save andyzhuangyy/7739a09f296cf4c5c47f588cd0265fdf to your computer and use it in GitHub Desktop.
decorator of log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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