Core
Understand the logger hierarchy, record model, tags, filters, handlers, and formatter flow in comon_logger.
Core
The comon_logger core is intentionally small. It gives you one structured record model and one propagation model that all other packages build on.
Main building blocks
| Piece | Responsibility |
|---|---|
Logger | Publish records and manage named hierarchy |
LogRecord | Immutable structured event |
LogFilter | Decide whether a handler should process a record |
LogHandler | Send accepted records to some output |
LogFormatter | Convert records to text for a handler |
Record flow
- Application code calls
log.info(...)or another level method. - A
LogRecordis created with message, time, metadata, and optional error data. - The record propagates through the logger hierarchy.
- Each attached handler applies its own filter.
- Accepted records are handled directly or formatted first.
Default mental model
- one
Logger.root - many named child loggers
- root handlers for global sinks
- optional child-specific handlers for focused outputs
Tags
Learn how level, layer, type, and feature tags shape filtering and debugging.
Filters
Filter records by severity, architectural layer, type, or custom combinations.
Handlers
Route records to console, files, memory, or custom destinations.
Formatters
Format records as readable console output or specialized text.