lograffe is a structured logger for modern C++. It is inspired by logrus and zap, similar libraries for the Go programming language.
lograffe's focus is on being a really fast and reliable structured logger. If you need a traditional logger with printf-like syntax, lograffe probably is not for you.
- header-only library
- convenient syntax for structured logging
- least possible overhead when a log level is not active
- for server applications: per-request log levels and sinks, also for multi-threaded processing within one request
- pluggable JSON, logfmt output formats
- default log level changeable at runtime
- zero-overhead custom log levels
#include <lograffe/lograffe.hpp>
#include <lograffe/alias.hpp> // alias lograffe namespace as logr
// ...
LOG(info) << "A group of animals emerges from the savanna" << logr::fields{
{ "animal", "giraffe" },
{ "size", giraffes.size() }
};
LOG(warn) << logr::fields{
{ "omg", true },
{ "number", 122 }
} << "The group's number increased " << "tremendously!";
Target | Description | Status |
---|---|---|
0.1 | basic functionality, unit tested | work in progress |
0.1 | performance testing + optimizations | to do |
0.5 | support for nested fields | to do |
0.5 | full documentation + examples | to do |
1.0 | further changes based on user feedback | to do |