Reference for hub_sdk/helpers/logger.py
Note
This file is available at https://github.com/ultralytics/hub-sdk/blob/main/hub_sdk/helpers/logger.py. If you spot a problem please help fix it by contributing a Pull Request 🛠️. Thank you 🙏!
hub_sdk.helpers.logger.Logger
Represents a logger configuration for handling log messages.
Attributes:
Name | Type | Description |
---|---|---|
logger_name |
str
|
Name of the logger. Defaults to the name of the calling module. |
log_format |
str
|
Format for log messages. Defaults to the value of 'LOGGER_FORMAT' environment variable or '%(asctime)s - %(name)s - %(levelname)s - %(message)s'. |
log_level |
str
|
Log level for the logger. Defaults to the value of 'LOGGER_LEVEL' environment variable or 'INFO'. |
logger |
Logger
|
The configured logger instance. |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
logger_name
|
str
|
Name of the logger. If not provided, defaults to the root logger. |
None
|
log_format
|
str
|
Format for log messages. Defaults to the value of 'LOGGER_FORMAT' environment variable or '%(asctime)s - %(levelname)s - %(message)s'. |
None
|
log_level
|
str
|
Log level for the logger. Defaults to the value of 'LOGGER_LEVEL' environment variable or 'INFO'. |
None
|
Source code in hub_sdk/helpers/logger.py
get_logger
Get the configured logger instance.
Returns:
Type | Description |
---|---|
Logger
|
The configured logger instance. |