Open mesteruh opened 3 months ago
The level
parameter is a minimum threshold. This is the conventional and recommended way of doing logging: you can adapts the logged details according to your needs during development or in production.
If you want only logs from a specific level, you need to use a filter:
logger.add(
sink=sys.stdout,
level="INFO",
filter=lambda record: record["level"].name == "INFO",
format=format_string,
colorize=True,
backtrace=False,
enqueue=False,
)
I have 2 sinks. When i use logger.exception('bla bla') its show traceback in both sinks. Why so? I wanna that exceptions messages go to
error
sink, and all other toinfo
sinkits raise exception to both sinks