hispecdrp.driver.logging
Functions
|
|
|
Replace all handlers on every managed logger with the given handler. |
|
|
|
|
|
|
|
|
|
The single entry point for all logging in hispecdrp. |
Install a default stdout handler on all managed loggers so records are visible outside any logging_context (e.g. at import time or in scripts). |
Classes
|
|
|
Only pass through records from hispecdrp or captured packages. |
|
- class LogConfig(*, level=None, enable_stdout=None, enable_file=None, log_dir=None, filename_prefix='hispecdrp_log', rotate=False, max_bytes=50000000, backup_count=5)[source]
Bases:
object- make_handlers()[source]
Build the real output handlers (stdout and/or file).
- class PackageCaptureFilter(name='')[source]
Bases:
FilterOnly pass through records from hispecdrp or captured packages.
- filter(record)[source]
- _close_queue()[source]
- _get_level(level)[source]
- _install_handler_on_managed_loggers(handler, level)[source]
Replace all handlers on every managed logger with the given handler. Sets propagate=False so records stop here and never reach root. Child loggers (e.g. hispecdrp.processing_component) are untouched — they have no handlers and propagate=True by default, so their records bubble up to the managed logger and fire exactly once.
- _make_file_handler(level, log_dir, filename_prefix, rotate, max_bytes, backup_count)[source]
- _make_formatter()[source]
- _make_stdout_handler(level)[source]
- _restore_managed_loggers(state)[source]
- _save_managed_loggers()[source]
- _start_listener(queue, handlers)[source]
- _stop_listener()[source]
- get_config_dir()[source]
- get_queue()[source]
- load_config_file(config_filepath)[source]
Read a configuration file and return its contents as a dictionary.
- logging_context(config_dict, queue=None)[source]
The single entry point for all logging in hispecdrp.
Outermost call owns the queue and listener for its full lifetime. Nested calls (e.g. a pipeline invoking a primitive that also calls logging_context) are no-ops — they yield immediately without touching the queue, so the outer context stays alive.
- setup_default_logging()[source]
Install a default stdout handler on all managed loggers so records are visible outside any logging_context (e.g. at import time or in scripts). Idempotent — skipped if hispecdrp already has handlers.