Logging¶
This page specifies logging-related helpers from inorbit_connector.logging.
setup_logger(config: LoggingConfig) -> None¶
Configures Python logging using the standard library logging.config.fileConfig.
Behavior:
If
config.config_fileis set, it is loaded vialogging.config.fileConfig(..., disable_existing_loggers=False, defaults=config.defaults).If
config.log_levelis set, the root logger level is overridden to that value after loading the config file.
LoggingConfig / LogLevels¶
LoggingConfigis the configuration model used bysetup_logger().LogLevelsis an enum ofDEBUG,INFO,WARNING,ERROR,CRITICAL.
ConditionalColoredFormatter¶
Formatter used by the package default logging configuration.
Behavior:
If
colorlogis installed, it usescolorlog.ColoredFormatter.Otherwise it falls back to
logging.Formatterand removes%(log_color)s/%(reset)stokens from the format string.
The default logging config (inorbit_connector/logging/logging.default.conf) references this formatter by class name.