Logging API¶
RedactingFilter is what configure_logging() actually installs (see Secrets).
Logging configuration for the OMOP stack.
LoggingConfig ¶
Bases: SecretSafeBaseModel
Logging overrides from the [logging] section of config.toml.
level overrides the verbosity-derived level for all OMOP loggers.
loggers applies fine-grained level overrides to specific named loggers
(e.g. {"sqlalchemy.engine": "INFO"}).
RedactingFilter ¶
Bases: Filter
Scrubs credential-bearing URLs before a handler emits its record.
A filter rather than a formatter, for two reasons.
It reaches handlers that do their own rendering. e.g. RichHandler -
a formatter attached to it governs only part of the result;
Handler filters run in Handler.handle() before emit(), so concole
and stream paths are covered by one mechanism and neither needs its own code
path.
It survives customisation. Replacing a handler's formatter is an ordinary thing to do and must not silently remove a security guarantee. Redaction is not a presentation concern, so it does not live in the presentation layer.
configure_logging ¶
configure_logging(
config: LoggingConfig | _HasLoggingConfig | None = None,
*,
verbosity: int = 0,
extra_namespaces: list[str] | None = None,
console: Any = None,
) -> None
Configure Python logging for the OMOP stack.
Safe to call multiple times; re-applying the same arguments is idempotent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
LoggingConfig | _HasLoggingConfig | None
|
A |
None
|
verbosity
|
int
|
Number of |
0
|
extra_namespaces
|
list[str] | None
|
Additional logger namespaces to configure alongside |
None
|
get_logger ¶
get_logger(name: str) -> logging.Logger
Return a named logger; single import point for consuming packages.