Skip to content

Instantly share code, notes, and snippets.

@leventengin
Created November 20, 2022 17:12
Show Gist options
  • Save leventengin/1a50a6d259f916dd3873ad61d33dc54c to your computer and use it in GitHub Desktop.
Save leventengin/1a50a6d259f916dd3873ad61d33dc54c to your computer and use it in GitHub Desktop.
this is a test gist
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