-
Notifications
You must be signed in to change notification settings - Fork 3
Home
logme is a C/C++ logging library designed for real-world systems where logging is not just debugging output, but a tool for operating and diagnosing a running application.
The library focuses on three things:
- low overhead when logging is disabled or filtered out
- efficient logging path when messages are actually written
- full control over logging behavior at runtime
This allows using detailed logging in production without paying the cost permanently.
Most logging libraries treat logging as something configured once at startup.
logme treats logging as a runtime system.
You can:
- enable or disable channels
- change log levels
- add or remove backends
- switch output formats
…all without restarting the application.
Logging in logme is built around a few core concepts.
A channel is the main logging entity.
It represents a logical part of the system (for example HTTP, TLS, or database).
A subsystem (SID) is an additional classification tag used for filtering inside a channel.
Messages are routed to backends, which define where logs are written (console, file, debug output, etc.).
Each log message is processed through an internal context, which handles formatting and structured output.
In addition to the default text format, logme supports structured logging in two ways.
First, it can produce JSON or XML directly at runtime.
Each message becomes a structured event suitable for real-time processing.
Second, existing logs can be converted using the logmefmt tool, allowing generation of finalized JSON or XML documents.
File logging is designed to work reliably in long-running systems.
logme supports:
- size-based rotation
- daily rotation
- limiting the number of log files
- limiting total directory size
Old files are removed automatically, while the active file is never affected.
File logging is performed asynchronously to avoid blocking the application.
Console output is coordinated to preserve message ordering even in multithreaded scenarios.
When logging is disabled, logme avoids unnecessary work.
The library uses a precheck mechanism that ensures formatting and argument evaluation are skipped whenever possible.
This optimization applies not only to disabled logging, but also to active logging paths, especially when using asynchronous backends.
logme works on major platforms (Windows, Linux, macOS) and supports modern C++ standards.
It provides native formatting support, allowing both printf-style usage and C++-style streaming.
Additional capabilities include:
- controlling message frequency (log once / log every N times)
- boot/early logging before configuration is loaded
These features are built into the core and do not require external components.
LogmeI("Server started on port %d", port);No initialization is required.
- Core Concepts
- Structured Logging
- File Rotation & Retention
- Runtime Control
- Advanced Features
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