_factory
Class to simplify generating loggers.
LoggerFactory
Generate loggers based on LoggerFactory's config.
Source code in src/red_logging/config_classes/loggers/_factory.py
__create_logger(name, log_level, handlers, formatters, loggers)
staticmethod
Create a logger cnofig from inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
The name of the logger. |
required |
log_level |
str
|
The log levels to show (NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL). |
required |
handlers |
dict[str, dict[str, Any]]
|
A dict describing the handlers for this logger config. |
required |
formatters |
dict[str, dict[str, Any]]
|
A dict describing the formatters for this logger config. |
required |
loggers |
dict[str, dict[str, Any]]
|
A dict describing the loggers for this logger config. |
required |
Source code in src/red_logging/config_classes/loggers/_factory.py
get_logger(name, log_level, handlers, formatters, loggers)
staticmethod
Initialize a logger.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name |
str
|
The name of the logger. |
required |
log_level |
str
|
The log levels to show (NOTSET, DEBUG, INFO, WARNING, ERROR, CRITICAL). |
required |
handlers |
dict[str, dict[str, Any]]
|
A dict describing the handlers for this logger config. |
required |
formatters |
dict[str, dict[str, Any]]
|
A dict describing the formatters for this logger config. |
required |
loggers |
dict[str, dict[str, Any]]
|
A dict describing the loggers for this logger config. |
required |