A high-performance C++17 logging library with zero dynamic allocations during log calls, supporting synchronous and asynchronous logging.
lwlog is a high-performance, header-only logging library for C++17 that provides both synchronous and asynchronous logging with zero dynamic memory allocations during log calls. It solves the problem of logging overhead in performance-critical applications by using pre-allocated static buffers and offering extensive configurability through policy-based design.
C++ developers working on performance-sensitive applications, such as game engines, real-time systems, embedded software, or high-throughput services, who need low-latency, customizable logging.
Developers choose lwlog for its benchmark-proven speed advantage over alternatives, its zero-allocation design that eliminates heap fragmentation, and its flexible, policy-driven architecture that allows fine-grained control over logging behavior without sacrificing ease of use.
Very fast synchronous and asynchronous C++17 logging library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses pre-allocated static buffers to eliminate dynamic memory allocations during log calls, reducing fragmentation and improving speed in high-frequency scenarios, as highlighted in the design philosophy.
Demonstrates significant performance advantages over spdlog in both synchronous and asynchronous modes, with detailed benchmarks showing up to 10x faster operations in some cases.
Easy to add custom sinks by inheriting from the base sink class and implementing sink_it(), with clear examples provided for stdout_sink and custom sinks.
Offers fine-grained control through template policies for threading, flushing, and overflow behavior, enabling tailored logging setups without runtime overhead.
Requires understanding of multiple template parameters and policies, making initial configuration more involved compared to simpler, macro-based logging libraries.
Patterns are compiled once at setup, hindering dynamic changes, and static buffer sizes are fixed at compile-time, which can lead to wasted memory or truncation if misconfigured.
The buffered flush policy improves performance but risks losing log messages if the application crashes before the buffer is flushed, as admitted in the README's policy descriptions.
Source metainformation features rely on compiler-specific intrinsics and may not work on older versions, such as Visual Studio pre-1927, limiting portability without C++20's std::source_location.