logging_helper¶
Deprecated alias for :mod:clabe.logging.
clabe.logging_helper was renamed to :mod:clabe.logging. This module re-exports the
same public names so existing imports keep working, but emits a :class:DeprecationWarning
on import. Update from clabe.logging_helper import ... (or clabe.logging_helper.x) to
clabe.logging — this alias will be removed in a future release.
add_file_handler ¶
add_file_handler(
logger: TLogger, output_path: PathLike
) -> TLogger
Adds a file handler to the logger to write logs to a file.
Creates a new file handler with UTC timezone formatting and adds it to the specified logger for persistent log storage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger
|
TLogger
|
The logger to which the file handler will be added |
required |
output_path
|
PathLike
|
The path to the log file |
required |
Returns:
| Name | Type | Description |
|---|---|---|
TLogger |
TLogger
|
The logger with the added file handler |
Source code in src/clabe/logging/_stdlib.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
close_file_handlers ¶
close_file_handlers(logger: TLogger) -> TLogger
Closes all file handlers associated with the logger.
Iterates through all handlers associated with the logger and closes any file handlers to ensure proper resource cleanup.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger
|
TLogger
|
The logger whose file handlers will be closed |
required |
Returns:
| Name | Type | Description |
|---|---|---|
TLogger |
TLogger
|
The logger with closed file handlers |
Source code in src/clabe/logging/_stdlib.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
configure_console_logging ¶
configure_console_logging() -> None
Installs clabe's default root-logger configuration (console handler, format, level).
Source code in src/clabe/logging/_stdlib.py
98 99 100 101 102 | |
set_console_level ¶
set_console_level(level: int) -> None
Sets the verbosity threshold of the interactive console log handler.
This only affects what is shown to the user on the console; it is fully
decoupled from what is written to the log file (see add_file_handler)
and from any remote handlers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
int
|
A standard |
required |
Source code in src/clabe/logging/_stdlib.py
105 106 107 108 109 110 111 112 113 114 115 116 | |
shutdown_logger ¶
shutdown_logger(logger: TLogger) -> TLogger
Shuts down the logger by closing all file handlers and calling logging.shutdown().
Performs a complete shutdown of the logging system, ensuring all file handlers are properly closed and resources are released.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger
|
TLogger
|
The logger to shut down |
required |
Returns:
| Name | Type | Description |
|---|---|---|
TLogger |
TLogger
|
The logger with closed file handlers |
Source code in src/clabe/logging/_stdlib.py
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | |