Log Settings
disruption_py.settings.log_settings.LogSettings
dataclass
¤
Settings for configuring logging.
ATTRIBUTE | DESCRIPTION |
---|---|
log_file_path |
Path to the log file. If None, no log file will be created (default is None).
TYPE:
|
file_log_level |
Logging level for the log file (default is logging.WARNING). Can be set to logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, or logging.CRITICAL.
TYPE:
|
log_file_write_mode |
File write mode for the log file (default is 'w').
TYPE:
|
log_to_console |
Whether to log messages to the console (default is True).
TYPE:
|
console_log_level |
Logging level for console output (default is logging.WARNING). Can be set to logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, or logging.CRITICAL.
TYPE:
|
use_custom_logging |
Whether to use custom logging setup (default is False). If True, no logging setup is done within this class.
TYPE:
|
_logging_has_been_setup |
Internal flag to prevent multiple setups (default is False).
TYPE:
|
Source code in disruption_py/settings/log_settings.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
logger ¤
logger(logger_name='disruption_py') -> logging.Logger
Get or set up the logger with the specified settings.
PARAMETER | DESCRIPTION |
---|---|
logger_name |
Name of the logger (default is "disruption_py").
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Logger
|
The configured logger instance. |
Source code in disruption_py/settings/log_settings.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
setup_logging ¤
setup_logging(
logger_name="disruption_py",
) -> logging.Logger
Set up logging based on the provided settings.
PARAMETER | DESCRIPTION |
---|---|
logger_name |
Name of the logger (default is "disruption_py").
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Logger
|
Configured logger instance. |
Source code in disruption_py/settings/log_settings.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
|