How to set log level for structlog
You can set the structlog log level by using the logging module:
structlog_set_level_examples.py
import logging
# Example 1: Output only DEBUG and higher levels
structlog.configure(
wrapper_class=structlog.make_filtering_bound_logger(logging.DEBUG),
)
# Example 2: Output only INFO and higher levels
structlog.configure(
wrapper_class=structlog.make_filtering_bound_logger(logging.INFO),
)Check out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow