guidellm.logger
Logger configuration for GuideLLM.
This module provides a flexible logging configuration using the loguru library. It supports console and file logging with options to configure via environment variables or direct function calls.
Environment Variables: - GUIDELLM__LOGGING__DISABLED: Disable logging (default: false). - GUIDELLM__LOGGING__CLEAR_LOGGERS: Clear existing loggers from loguru (default: true). - GUIDELLM__LOGGING__CONSOLE_LOG_LEVEL: Log level for console logging (default: none, options: DEBUG, INFO, WARNING, ERROR, CRITICAL). - GUIDELLM__LOGGING__LOG_FILE: Path to the log file for file logging (default: guidellm.log if log file level set else none) - GUIDELLM__LOGGING__LOG_FILE_LEVEL: Log level for file logging (default: INFO if log file set else none).
If logging isn't responding to the environment variables, run the guidellm env command to validate that the environment variables match and are being set correctly.
Usage: from guidellm import logger, configure_logger, LoggerConfig
# Configure metrics with default settings
configure_logger(
config=LoggingConfig
disabled=False,
clear_loggers=True,
console_log_level="DEBUG",
log_file=None,
log_file_level=None,
)
)
logger.debug("This is a debug message")
logger.info("This is an info message")
configure_logger(config=settings.logging)
Configure the metrics for LLM Compressor. This function sets up the console and file logging as per the specified or default parameters.
Note: Environment variables take precedence over the function parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config | LoggingSettings | The configuration for the logger to use. | logging |