InfDBLogger Class
Console + file logging with a multiprocessing-safe queue listener.
__init__(log_path: str, level: str = 'INFO', cleanup: bool = False) -> None
¶
Initializes the root logger, handlers, and a QueueListener.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_path
|
str
|
Path to the log file to write. |
required |
level
|
str
|
Logging level name (e.g., 'INFO', 'DEBUG'). |
'INFO'
|
cleanup
|
bool
|
If True, remove any existing log file at |
False
|
stop()
¶
Flushes and stops the QueueListener.
setup_worker_logger() -> logging.Logger
¶
Creates a logger for worker processes that forwards to the queue.
Returns:
| Type | Description |
|---|---|
Logger
|
A logger configured with a QueueHandler that sends records to the root listener. |