mirror of https://github.com/Delgan/loguru.git
24 lines
586 B
Python
24 lines
586 B
Python
import sys
|
|
|
|
from loguru import logger
|
|
|
|
|
|
def test(*, backtrace, colorize, diagnose):
|
|
logger.remove()
|
|
logger.add(sys.stderr, format="", colorize=colorize, backtrace=backtrace, diagnose=diagnose)
|
|
|
|
def foo():
|
|
1 / 0
|
|
|
|
try:
|
|
exec("foo()")
|
|
except ZeroDivisionError:
|
|
logger.exception("")
|
|
|
|
|
|
test(backtrace=True, colorize=True, diagnose=True)
|
|
test(backtrace=False, colorize=True, diagnose=True)
|
|
test(backtrace=True, colorize=True, diagnose=False)
|
|
test(backtrace=False, colorize=True, diagnose=False)
|
|
test(backtrace=False, colorize=False, diagnose=False)
|