from datetime import datetime def logger(func): def wrapper(*args, **kwargs): print('_' * 25) print(f'Run on: {datetime.today().strftime("%Y-%m-%d %H:%M:%S")}') print(f'Running function: {func.__name__}') func(*args, **kwargs) print('_' * 25) return wrapper
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter