
Quill
Ultra-Low-Latency Asynchronous C++17 Logging and Metrics Library
🔬 Try It Online
·
🚀 Benchmarks
·
📚 Documentation
·
⚡ Recipes
·
❓ FAQ
🐛 Report Bug
·
💡 Request Feature

🧭 Table of Contents
✨ Introduction
Quill is an asynchronous logging and metrics library for C++17 and later. It keeps formatting and I/O away from latency-sensitive application threads by encoding log arguments on the frontend and processing them on a dedicated backend worker.
- Low Frontend Latency: Log arguments are encoded and queued for asynchronous processing, minimizing work on the calling thread. See the latency benchmarks for measured results and methodology.
- Deferred Formatting: Expensive formatting is performed by the backend worker instead of the calling thread.
- Logging and Metrics: Publish pre-registered metrics through the same asynchronous backend. The bundled Prometheus sink handles common metric types, while custom sinks can route samples to StatsD, OpenTelemetry, or other collectors. See the Metrics guide.
- Highly Customizable: Tune frontend queues and memory policy at compile time; configure backend idle behaviour, CPU affinity, buffering, timestamp handling, flushing, and callbacks at runtime; and compose loggers from built-in or custom sinks with per-sink filters. See Frontend Options, Backend Options, and Sinks.
- Production-Focused Testing: Continuously tested across Linux, macOS, Windows, and BSD, with sanitizers and fuzzing.
Using Quill? Click Star at the top of the GitHub repository to help other C++ developers discover it.
⏩ Quick Start
Getting started is easy and straightforward. Follow these steps to integrate the library into your project:
Installation
You can install Quill using the package manager of your choice:
| Package Manager | Installation Command |
|---|---|
| vcpkg | vcpkg install quill |
| Conan | conan install quill |
| Homebrew | brew install quill |
| Meson WrapDB | meson wrap install quill |
| Conda | conda install -c conda-forge quill |
| Bzlmod | bazel_dep(name = "quill", version = "x.y.z") |
| xmake | xrepo install quill |
| nix | nix-shell -p quill-log |
| build2 | libquill |
Setup
Quickest Setup
For the shortest path from zero to working logs, use simple_logger():
#include "quill/SimpleSetup.h"
#include "quill/LogMacros.h"
int main()
{
// log to the console
auto* logger = quill::simple_logger();
LOG_INFO(logger, "Hello from {}!", "Quill");
// log to a file
auto* logger2 = quill::simple_logger("test.log");
LOG_WARNING(logger2, "This message goes to a file");
}
Console output:
20:07:18.423476231 [48917] main.cpp:8 LOG_INFO Hello from Quill!
Detailed Setup
If you want explicit control over backend options, logger names, sinks, or formatters, use the
Backend and Frontend APIs directly:
#include "quill/Backend.h"
#include "quill/Frontend.h"
#include "quill/LogMacros.h"
#include "quill/Logger.h"
#include "quill/sinks/ConsoleSink.h"
#include <string_view>
int main()
{
quill::Backend::start();
quill::Logger* logger = quill::Frontend::create_or_get_logger(
"root", quill::Frontend::create_or_get_sink<quill::ConsoleSink>("sink_id_1"));
LOG_INFO(logger, "Hello from {}!", std::string_view{"Quill"});
}
Output:
20:07:18.