structlog_config.levels ======================= .. py:module:: structlog_config.levels Functions --------- .. autoapisummary:: structlog_config.levels.get_environment_log_level_as_string structlog_config.levels.compare_log_levels structlog_config.levels.resolve_level_name structlog_config.levels.is_debug_level Module Contents --------------- .. py:function:: get_environment_log_level_as_string() -> str .. py:function:: compare_log_levels(left: str, right: str) -> int Compare log levels using logging.getLevelNamesMapping for accurate int values. Example: >>> compare_log_levels("DEBUG", "INFO") -1 # DEBUG is less than INFO Asks the question "Is INFO higher than DEBUG?" .. py:function:: resolve_level_name(level_name: str) -> int | None Translate a log level name to its numeric value .. py:function:: is_debug_level() -> bool Return True when the global logger is configured for DEBUG or TRACE verbosity. Helpful for enabling `debug` flags on various 3rd party libraries. This makes it easy to turn on debug modes globally via LOG_LEVEL environment variable.