odygrd.quill
importAsynchronous logging through the upstream quill C++ module
import quill;
mcpp add odygrd.quill@13.0.0
Usage
From this repository's own test project — built and run by CI, not written for the website.
import std;
import quill;
#define QUILL_USE_MODULE
#include <quill/LogMacros.h>
bool log_from_worker(quill::Logger* expected);
bool check_logging(std::filesystem::path const& filename) {
quill::Backend::start();
quill::FileSinkConfig config;
config.set_open_mode('w');
auto sink = quill::Frontend::create_or_get_sink<quill::FileSink>(filename.string(), config);
auto* logger = quill::Frontend::create_or_get_logger(
"quill-module-test", sink, quill::PatternFormatterOptions{"%(message)"});
logger->set_log_level(quill::LogLevel::Info);
LOG_INFO(logger, "macro answer={} text={}", 42, std::string{"hello"});
LOG_DEBUG(logger, "filtered main message");
bool worker_ok = false;
{
std::jthread worker([&] { worker_ok = log_from_worker(logger); });
// …
tests/examples/quill-module/tests/quill.cpp · project tests/examples/quill-module
Build
- modules
quill- targets
quill (lib)- language
c++23- import std
- no
- include dirs
*/include
Sources (1)
*/src/quill.cppm
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
13.0.0 latest |
LinuxWindowsmacOS | source | 88b4a1542125… |