loguru/tests/exceptions/source/diagnose/encoding.py

21 lines
270 B
Python

import sys
from loguru import logger
logger.remove()
logger.add(sys.stderr, format="", colorize=True, backtrace=False, diagnose=True)
def _deep(val):
return 1 / val
def div():
return _deep("")
try:
div()
except TypeError:
logger.exception("")