Created
November 20, 2022 17:12
-
-
Save leventengin/1a50a6d259f916dd3873ad61d33dc54c to your computer and use it in GitHub Desktop.
this is a test gist
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 log(utf8_string, tags): | |
... | |
def log_on_exception(func): | |
@functools.wraps(func) | |
def wrapper_logon_exception(*args, **kwargs): | |
if not tag1 or not tag2: | |
return log('an error', tag1, tag2) | |
return func(*args, **kwargs) | |
return wrapper_logon_exception | |
@log_on_exception('tag1', 'tag2') | |
def fn(): | |
raise Exception('Some message') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment