Overview of Quill features
masterQuill is a high-performance, asynchronous C++ logging library designed for ultra-low latency. Key features include:
- Asynchronous Processing: A background thread handles formatting and I/O to keep the main thread responsive.
- Metric Publishing: Supports publishing metric samples to Prometheus, StatsD, OpenTelemetry, or in-process collectors via the asynchronous backend.
- Minimal Header Includes:
- Frontend: Use only
Logger.handLogMacros.hfor lightweight logging with minimal dependencies. - Backend: Single
.cppfile inclusion; no backend code injection into other translation units.
- Frontend: Use only
- Compile-Time Optimization: Ability to eliminate specific log levels at compile time.
- Customization: Supports custom formatters, multiple output sinks (Console with color, files with rotation, JSON, and custom sinks), and log filtering.
- Advanced Logging Capabilities:
- Timestamp-Ordered Logs: Chronologically ordered logs for easier multithreaded debugging.
- Flexible Timestamps: Support for
rdtsc,chrono, orcustom clocks. - Backtrace Logging: Ring buffer storage for on-demand log display.
- Mapped Diagnostic Context (MDC): Thread-local key/value context attached to subsequent log lines.
- Rate-Limited Macros: Use
LOG_*_LIMITorLOGV_*_LIMITto emit at most once per configured interval per call site.
- Reliability and Performance:
- Crash Handling: Built-in signal handler to preserve logs during crashes.
- Configurable Queue Modes: Options for
bounded/unboundedandblocking/droppingwith monitoring for dropped messages and blocked threads. - Huge Pages Support (Linux): Optimized performance using huge pages on the hot path.
- Type-Safe API: Built on the
{fmt}library. - Exception-Free Option: Configurable builds with or without exception handling.