Skip to content

KiNgMaR/lograffe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lograffe

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.

Some design goals

  • 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

Examples

#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!";

Status / Roadmap

TargetDescriptionStatus
0.1basic functionality, unit testedwork in progress
0.1performance testing + optimizationsto do
0.5support for nested fieldsto do
0.5full documentation + examplesto do
1.0further changes based on user feedbackto do

About

Structured Logging for Modern C++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published