How mengrao/fmtlog works
fmtlog is a C++ asynchronous logging library. Applications submit formatted log calls into per-thread queues; a caller-driven poller or optional background polling thread collects messages in time order, formats headers and messages, then writes to stdout or a configured file and can invoke a callback. The graph also includes runtime filtering, rate-limited logging, and timestamp calibration. Relationships for documented capabilities rely on the README; sampled source excerpts show the API macros, queue and polling behavior, but do not expose every implementation detail.
Main entry points: fmtlog-inl.h Polling · fmtlog.h Logging API
Components 16
Log submission
- Logging API
fmtlog.h - Level filtering
fmtlog.h - Rate limiting
fmtlog.h - Log producer
fmtlog-inl.h - Thread queues
fmtlog.h
Collection and formatting
- Polling
fmtlog-inl.h - Timestamp calibration
fmtlog.h - Time ordering
fmtlog-inl.h - Message formatting
fmtlog-inl.h - Header patterns
fmtlog-inl.h - Background poller
fmtlog-inl.h
Output and controls
- File and stdout
fmtlog-inl.h - Log callback
fmtlog-inl.h - Buffer flushing
fmtlog-inl.h
Other components
- Application
- fmt library
Connections 18
- Application → Logging API: logs through
README.md - Logging API → Level filtering: checks level
fmtlog.h - Logging API → Rate limiting: limits frequency
fmtlog.h - Logging API → Log producer: submits message
fmtlog.h - Log producer → Thread queues: enqueues
fmtlog-inl.h - Application → Polling: polls
README.md - Background poller → Polling: runs periodically
fmtlog-inl.h - Polling → Thread queues: collects messages
fmtlog-inl.h - Polling → Timestamp calibration: calibrates clock
fmtlog-inl.h - Polling → Time ordering: merges by time
fmtlog-inl.h - Polling → Message formatting: processes messages
fmtlog-inl.h - Message formatting → Header patterns: adds header
README.md - Message formatting → fmt library: formats with
README.md - Polling → File and stdout: writes output
README.md - Polling → Log callback: invokes callback
README.md - Polling → Buffer flushing: flushes buffer
README.md - Buffer flushing → File and stdout: writes buffered data
README.md - Application → Background poller: starts optionally
README.md