Logging Cfg
app.shared.logging_cfgModule for logging cfg; provides reusable helpers across application layers.
See Also
normalize_log_level— validates configured logging levelsvalidate_log_file_path— validates log destinations
Layer: Shared utilities. Context: Provides reusable helpers across application layers at this architectural boundary.
configure_logging(*, console_level: str = 'INFO', file_level: str = 'DEBUG', log_file_path: str = 'logs/app.log', enabled_areas: set[str] | None = None) -> None
Configure application log sinks and area-based filtering.
| PARAMETER | DESCRIPTION |
|---|---|
console_level
|
Minimum level written to stderr; environment configuration may override it.
TYPE:
|
file_level
|
Minimum level written to the log file; environment configuration may override it.
TYPE:
|
log_file_path
|
Destination file path; environment configuration may override it.
TYPE:
|
enabled_areas
|
Optional allowlist of logger area names;
TYPE:
|
get_logger(area: str) -> Logger
Return a Loguru logger bound to an application area.
| PARAMETER | DESCRIPTION |
|---|---|
area
|
Name attached to emitted records as
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Logger
|
Logger that includes the supplied area in its extra context. |