Log Settings
disruption_py.settings.log_settings.LogSettings
dataclass
¤
Settings for configuring logging.
ATTRIBUTE | DESCRIPTION |
---|---|
file_path |
Path to the log file. If None, no log file will be created. By default, a log file will be created in a temporary folder.
TYPE:
|
file_level |
Logging level for the log file (default is "DEBUG"). Possible values are: "TRACE", "DEBUG", "VERBOSE" (custom), "INFO", "SUCCESS", "WARNING", "ERROR", "CRITICAL". See: https://loguru.readthedocs.io/en/stable/api/logger.html#levels
TYPE:
|
console_level |
The log level for the console. Default is None, so log level will be determined dynamically based on the number of shots. Possible values are: "TRACE", "DEBUG", "VERBOSE" (custom), "INFO", "SUCCESS", "WARNING", "ERROR", "CRITICAL". See: https://loguru.readthedocs.io/en/stable/api/logger.html#levels
TYPE:
|
warning_threshold |
If number of shots is greater than this threshold, the console log level will be "WARNING". Default is 1000.
TYPE:
|
success_threshold |
If number of shots is greater than this threshold and less than the warning_threshold, the console log level will be "SUCCESS". Default is 500.
TYPE:
|
info_threshold |
If number of shots is greater than this threshold and less than the success_threshold, the console log level will be "INFO". Default is 50.
TYPE:
|
_logging_has_been_setup |
Internal flag to prevent multiple setups (default is False).
TYPE:
|
Source code in disruption_py/settings/log_settings.py
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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
reset_handlers ¤
reset_handlers(num_shots: int = None)
Remove default logger and set up custom handlers.
PARAMETER | DESCRIPTION |
---|---|
num_shots
|
Number of shots to determine the console log level dynamically.
TYPE:
|
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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
setup_logging ¤
setup_logging()
Set up logging with custom styles and levels.
Source code in disruption_py/settings/log_settings.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|