mirror of https://github.com/Delgan/loguru.git
20 lines
316 B
Python
20 lines
316 B
Python
import sys
|
|
|
|
from loguru import logger
|
|
|
|
logger.remove()
|
|
logger.add(sys.stderr, format="", colorize=True, backtrace=False, diagnose=True)
|
|
|
|
|
|
code = """
|
|
if True:
|
|
a = 5
|
|
print("foobar") #intentional faulty indentation here.
|
|
b = 7
|
|
"""
|
|
|
|
try:
|
|
exec(code)
|
|
except IndentationError:
|
|
logger.exception("")
|