-
Notifications
You must be signed in to change notification settings - Fork 3
Core Concepts
logme is built around a small number of concepts that work together.
Understanding how they relate to each other is more important than memorizing individual features.
When a log message is written, logme does three things:
- decides whether the message should be logged
- prepares the message (formatting, metadata)
- sends it to one or more outputs
These responsibilities are split between different parts of the system.
A channel is the main logging entity.
You can think of it as a named source of messages — for example HTTP, TLS or DB.
Channels control whether messages are emitted and at what level.
When a logging macro is called, the first decision is made at the channel level: should this message be processed at all.
A subsystem is an additional tag attached to a message.
It does not exist on its own and cannot be enabled or disabled directly.
Instead, it is used to refine filtering inside a channel.
In practice, channels answer “which part of the system”,
while subsystems answer “which aspect inside that part”.
A backend defines where messages are written.
Typical examples are console output, files or debugger output.
A single message can be sent to multiple backends at the same time.
Backends do not decide whether a message should exist —
they only handle delivering it somewhere.
When a message passes the channel check, logme creates an internal representation of it.
This representation is called a context.
The context contains:
- the message text (or formatting data)
- metadata such as level and time
- structured fields if they are used
The context is then passed through formatting and finally to backends.
Putting it all together:
- application calls a logging macro
- channel decides whether the message is enabled
- context is created
- message is formatted
- message is sent to backends
This separation allows logme to:
- avoid unnecessary work when logging is disabled
- change behavior at runtime (channels, backends, levels)
- support multiple output formats without changing application code
Channels control what is logged.
Backends control where it goes.
Subsystems refine filtering.
Context carries the message through the system.
logme — flexible runtime logging system
Home · Getting Started · Architecture · Output · Backends · Configuration
GitHub: https://github.com/efmsoft/logme
- Home
- Getting Started
- Why logme?
- Core Concepts
- Logging Macros
- Fatal Handling
- Crash Logging
- glog Compatibility
- C API
- Choosing Logging Macros
- Function tracing
- Trace Points
- Override Scopes
- Advanced Features
- Collapse Logging
- Feature Map
- Overview
- Console Backend
- Debugger Backend
- File Backend
- File Rotation & Retention
- Buffer Backend
- Ring Buffer Backend
- SharedFile Backend
- Callback Backend
- Windows Event Log Backend
- Custom Backends
- Runtime Control
- Configuration
- Configuration JSON
- Control Server
- Environment Control
- Control Policies
- Trace Points
- Message Filtering