loguru/tests/exceptions/source/others/catch_as_function.py

15 lines
187 B
Python

import sys
from loguru import logger
logger.remove()
logger.add(sys.stderr, format="", diagnose=False, backtrace=False, colorize=False)
def a():
1 / 0
a = logger.catch()(a)
a()