Skip to content

Instantly share code, notes, and snippets.

@r3dm1ke
Last active October 30, 2020 01:17
def logging_decorator(func):
def logging_wrapper(*args, **kwargs):
print(f'Before {func.__name__}')
func(*args, **kwargs)
print(f'After {func.__name__}')
return logging_wrapper
@logging_decorator
def sum(x, y):
print(x + y)
sum(2, 5)
> Before sum
> 7
> After sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment