-
Notifications
You must be signed in to change notification settings - Fork 3
Examples FormatApi
Eduard Mishkurov edited this page Jun 10, 2026
·
7 revisions
This example shows the supported formatting styles.
-
std::format-style logging when it is enabled - Fallback to stream / printf style when
std::formatsupport is disabled - Logging both to the default channel and to a custom channel
- The
fLogme...macros are available only whenLOGME_DISABLE_STD_FORMATis not defined.
2026-06-10 14:51:43:600 main(): Hello format, value=123
2026-06-10 14:51:43:600 W main(): Hex: 0xAB
Repository folder: examples/FormatApi
#include <Logme/Logme.h>
int main()
{
Logme::ID ch{"fmt"};
auto channel = Logme::Instance->CreateChannel(ch);
channel->AddLink(::CH);
#ifndef LOGME_DISABLE_STD_FORMAT
fLogmeI("Hello {}, value={}", "format", 123);
fLogmeW(ch, "Hex: 0x{:X}", 0xAB);
#else
LogmeI() << "Hello " << "format" << ", value=" << 123;
LogmeW(ch, "Hex: 0x%X", 0xAB);
#endif
return 0;
}Previous: EnvironmentControl | Next: Multithread
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