logging_config¶
src.utils.io.logging_config
¶
Centralized logging configuration for the ReproDB pipeline.
JSONFormatter
¶
Bases: Formatter
Emit each log record as a single JSON line.
Fields: ts (ISO-8601), level, logger, message,
plus exc when an exception is attached.
Source code in src/utils/io/logging_config.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | |
add_log_level_arg(parser: argparse.ArgumentParser) -> None
¶
Add --log-level and --log-format arguments to an argparse parser.
Source code in src/utils/io/logging_config.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 | |
setup_logging(level: int = logging.INFO, *, log_format: str = 'text') -> None
¶
Configure root logger with a consistent format.
Call once from each script's if __name__ == "__main__" block::
from src.utils.io.logging_config import setup_logging
setup_logging()
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
int
|
|
INFO
|
log_format
|
str
|
|
'text'
|
Source code in src/utils/io/logging_config.py
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 | |