Last active
November 19, 2020 15:20
-
-
Save Dliv3/59c136f5e0bcd8e09b17319faeb44c30 to your computer and use it in GitHub Desktop.
dlive python debugging decorator
This file contains hidden or 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 dliveDebugStr(string): | |
print('\033[32m[DLIVE DEBUG] >>> {}\033[0m'.format(string)) | |
def dliveDebugFunc(func): | |
def wrapper(*args, **kw): | |
dliveDebugStr('{}.{}'.format(args[0].__class__.__name__, func.__name__)) | |
# for each in args: | |
# dliveDebugStr('| -- {}'.format(each)) | |
# for i in kw: | |
# dliveDebugStr('| -- {} => {}'.format(i, kw[i])) | |
return func(*args, **kw) | |
return wrapper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment