Popularity
1.3
Stable
Activity
7.2
-
19
2
3

Description

XTR is a C++ logging library aimed at applications with low-latency or real-time requirements. The cost of log statements is minimised by delegating as much work as possible to a background thread. Work done at the log statement call-site is minimized---for example a no argument log statement only involves writing a single pointer to a ring buffer.

It is designed so that the cost of a log statement is consistently fast---i.e. every call is fast, not just the average case. No allocations or system calls are made when a log statement is made.

Programming language: C++
License: MIT License
Tags: Logging     Linux     Low Latency     C++20    

xtr alternatives and similar libraries

Based on the "Logging" category.
Alternatively, view xtr alternatives based on common mentions on social networks and blogs.

  • spdlog

    9.6 8.7 L1 xtr VS spdlog
    Fast C++ logging library.
  • glog

    C++ implementation of the Google logging module
  • Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
  • Easylogging++

    C++ logging library. It is extremely powerful, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
  • easyloggingpp

    C++ logging library. It is extremely powerful, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
  • plog

    6.9 6.3 L4 xtr VS plog
    Portable, simple and extensible C++ logging library
  • log4cplus

    log4cplus is a simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration. It is modelled after the Java log4j API.
  • loguru

    A lightweight C++ logging library
  • G3log

    5.7 7.2 L3 xtr VS G3log
    G3log is an asynchronous, "crash safe", logger that is easy to use with default logging sinks or you can add your own. G3log is made with plain C++14 (C++11 support up to release 1.3.2) with no external libraries (except gtest used for unit tests). G3log is made to be cross-platform, currently running on OSX, Windows and several Linux distros. See Readme below for details of usage.
  • quill

    Asynchronous Low Latency C++ Logging Library
  • reckless

    Reckless logging. Low-latency, high-throughput, asynchronous logging library for C++.
  • Boost.Log

    Boost Logging library
  • Blackhole

    Yet another logging library.
  • mini-async-log

    Non bloated asynchronous logger
  • lwlog

    Very fast synchronous and asynchronous C++17 logging library
  • logog

    logog is a portable C++ library to facilitate logging of real-time events in performance-oriented applications, such as games. It is especially appropriate for projects that have constrained memory and constrained CPU requirements.
  • Description

    Mini async log C port. Now with C++ wrappers.
  • uberlog

    Cross platform multi-process C++ logging system
  • Serenity Logger

    Yet another Fast and Efficient logging framework. The goal is to be nanosecond level fast with extensibility (inspired by loggers such as spdlog, nanolog, and fmtlog and heavily influenced by the formatting used in fmtlib and <format>). This uses a built-in formatter that can be swapped out for <format> or fmtlib if desired.
  • Log4cpp

    A library of C++ classes for flexible logging to files, syslog, IDSA and other destinations. [LGPL]
  • templog

    A very small and lightweight C++ library which you can use to add logging to your C++ applications. [Boost]

Do you think we are missing an alternative of xtr or a related project?

Add another 'Logging' Library

README

xtr

Ubuntu-GCC Ubuntu-GCC-Conan Ubuntu-GCC-Sanitizer Ubuntu-GCC-CMake

Ubuntu-Clang Ubuntu-Clang-Sanitizer

FreeBSD-13-GCC FreeBSD-14-GCC

FreeBSD-13-Clang FreeBSD-14-Clang

codecov Documentation CodeQL

What is it?

XTR is a C++ logging library aimed at applications with low-latency or real-time requirements. The cost of log statements is minimised by delegating as much work as possible to a background thread.

It is designed so that the cost of a log statement is consistently fast---i.e. every call is fast, not just the average case. No allocations or system calls are made when a log statement is made.

Features

  • Fast (please see benchmark results).
  • No allocations when logging, even when logging strings.
  • Formatting, I/O etc are all delegated to a background thread. Work done at the log statement call-site is minimized---for example a no argument log statement only involves writing a single pointer to a ring buffer.
  • Safe: No references taken to arguments unless explicitly requested.
  • Comprehensive suite of unit tests which run cleanly under AddressSanitizer, UndefinedBehaviourSanitizer, ThreadSanitizer and LeakSanitizer.
  • Log sinks with independent log levels (so that levels for different subsystems may be modified independently).
  • Ability to modify log levels via an external command.
  • Non-printable characters are sanitized for safety (to prevent terminal escape sequence injection attacks).
  • Formatting done via fmtlib.
  • Support for custom I/O back-ends (e.g. to log to the network or syslogd).
  • Support for logrotate integration.
  • Support for systemd journal integration.

Supported platforms

  • Linux (x86-64)
  • FreeBSD (x86-64)

Documentation

https://choll.github.io/xtr

Benchmarks

Below is the output of make benchmark on a stock Ryzen 5950X, with g++ version 10.2.1. No cores are isolated. Benchmarks with isolation, and on other CPUs will be completed soon.

2021-07-31 22:30:11
Running build/g++-release/benchmark/benchmark
Run on (32 X 6614.06 MHz CPU s)
CPU Caches:
  L1 Data 32K (x16)
  L1 Instruction 32K (x16)
  L2 Unified 512K (x16)
  L3 Unified 32768K (x2)
Load Average: 1.26, 1.53, 1.42
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
-----------------------------------------------------------------------------------------
Benchmark                                               Time             CPU   Iterations
-----------------------------------------------------------------------------------------
logger_benchmark_discard                             3.12 ns         3.11 ns    220642542
logger_benchmark_devnull                             3.17 ns         3.16 ns    213233572
logger_benchmark_tsc_discard                         9.97 ns         9.95 ns     71544694
logger_benchmark_tsc_devnull                         9.81 ns         9.79 ns     72024706
logger_benchmark_clock_realtime_coarse_discard       9.50 ns         9.48 ns     75301078
logger_benchmark_clock_realtime_coarse_devnull       9.02 ns         8.99 ns     77431937
logger_benchmark_int_discard                         4.64 ns         4.63 ns    151861070
logger_benchmark_int_devnull                         4.62 ns         4.61 ns    151949835
logger_benchmark_long_discard                        4.61 ns         4.60 ns    151969132
logger_benchmark_long_devnull                        4.61 ns         4.60 ns    152198709
logger_benchmark_double_discard                      4.84 ns         4.82 ns    145809754
logger_benchmark_double_devnull                      4.81 ns         4.80 ns    145367066
logger_benchmark_c_str_discard                       7.63 ns         7.60 ns     93103583
logger_benchmark_c_str_devnull                       7.33 ns         7.30 ns     95755773
logger_benchmark_str_view_discard                    5.69 ns         5.66 ns    122769764
logger_benchmark_str_view_devnull                    5.67 ns         5.64 ns    124657115
logger_benchmark_str_discard                         7.36 ns         7.33 ns     96002018
logger_benchmark_str_devnull                         7.32 ns         7.29 ns     96072575
logger_benchmark_non_blocking_discard                3.13 ns         3.12 ns    224529741
logger_benchmark_non_blocking_devnull                3.09 ns         3.08 ns    228207878

Installation notes

See [INSTALL.md](INSTALL.md)