guidellm.logger
Logger configuration for GuideLLM.
This module provides logging configuration using the loguru library. Console and file handlers are configured via :func:configure_logger, which is the primary runtime API. Environment variables populate fallback defaults in :class:~guidellm.settings.LoggingSettings at import time only.
Environment Variables (import-time fallback defaults): - GUIDELLM__LOGGING__CONSOLE_LOG_LEVEL: Console log level (default: INFO; set empty to disable). - GUIDELLM__LOGGING__CONSOLE_COLORIZE: Console ANSI colorization (default: auto; options: auto, true, false). - GUIDELLM__LOGGING__LOG_FILE: Path to the log file for file logging. - GUIDELLM__LOGGING__LOG_FILE_LEVEL: Log level for file logging.
Usage: from guidellm import logger, configure_logger from guidellm.settings import LoggingSettings
configure_logger(
config=LoggingSettings(
console_log_level="DEBUG",
console_colorize="auto",
)
)
logger.info("This is an info message")
ConsoleLogHandler
Owns the console sink; removes and replaces on each configure call.
Source code in src/guidellm/logger.py
FileLogHandler
Owns the file sink; removes and replaces on each configure call.
Source code in src/guidellm/logger.py
configure_logger(config=None)
Configure console and file logging handlers.
Idempotent: calling twice replaces existing sinks rather than stacking them. When config is None, uses :data:~guidellm.settings.settings.logging as fallback defaults (import-time bootstrap only).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config | LoggingSettings | None | Explicit logging configuration. | None |
Source code in src/guidellm/logger.py
reinstall_inherited_logger(parent_logger)
Replace the child-process module logger core with the parent's inherited core.
Loguru's public reinstall() is not yet available in all releases; this helper mirrors that behavior and delegates when present.
TODO: Remove this shim when loguru > 0.7.3 is the minimum supported version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parent_logger | Logger | Logger instance passed from the parent process. | required |