The spdlog project, a high-performance C++ logging library, has recently focused on resolving compilation issues, particularly with GCC 8.5, as addressed by Eugene Smirnov. This effort underscores the project's commitment to maintaining compatibility across various compilers.
The spdlog library is designed to provide fast and flexible logging capabilities for C++ applications. It supports both synchronous and asynchronous logging, multiple log targets, and extensive formatting options via the fmt library.
Recent pull requests and issues have highlighted a focus on enhancing compatibility and addressing bugs. For instance, PR #3128 introduces attribute support for logging, which could improve context management but raises concerns about race conditions in multi-threaded environments. PR #3157 aims to improve static variable initialization but has led to memory leak issues.
Eugene Smirnov (esmirno)
ansicolor_sink.h
and base_sink.h
.zjyhjqs
Alex Overchenko (AJIOB)
FMT_ENFORCE_COMPILE_STRING
.Ziyao (ziyao233)
Philippe Vaucher (Silex)
syslog_sink
.Dominik Grabiec (DominikGrabiec)
wincolor_sink
.Gabi Melman (gabime)
Timespan | Opened | Closed | Comments | Labeled | Milestones |
---|---|---|---|---|---|
7 Days | 4 | 7 | 12 | 4 | 1 |
30 Days | 11 | 11 | 30 | 11 | 1 |
90 Days | 43 | 29 | 126 | 43 | 1 |
1 Year | 197 | 182 | 775 | 197 | 1 |
All Time | 2140 | 2092 | - | - | - |
Like all software activity quantification, these numbers are imperfect but sometimes useful. Comments, Labels, and Milestones refer to those issues opened in the timespan in question.
Developer | Avatar | Branches | PRs | Commits | Files | Changes |
---|---|---|---|---|---|---|
Eugene Smirnov | 1 | 1/1/0 | 1 | 2 | 10 | |
Lixingcong (lixingcong) | 0 | 1/0/0 | 0 | 0 | 0 | |
喜多喜多 (RickSchanze) | 0 | 1/0/1 | 0 | 0 | 0 | |
Jaroslaw Pelczar (jarekpelczar) | 0 | 1/0/0 | 0 | 0 | 0 | |
Sivachandran Paramasivam (sivachandran) | 0 | 1/0/1 | 0 | 0 | 0 |
PRs: created by that dev and opened/merged/closed-unmerged during the period
The spdlog repository currently has 48 open issues, with recent activity indicating a mix of questions, bugs, and feature requests. Notably, several issues highlight compatibility problems with different versions of the fmt library, particularly with the transition to fmt 10.0.0 and above. There are also recurring themes around logging behavior in multi-threaded environments and the handling of log levels.
Several issues exhibit anomalies, such as users experiencing crashes or unexpected behavior when using asynchronous logging or specific sink configurations. For example, there are reports of segmentation faults when using async loggers on certain platforms, and issues with logger configurations leading to empty log files. These suggest potential areas for improvement in thread safety and error handling.
Issue #3168: Q: Start newline every time we are starting the log
Issue #3167: spdlog example project doesn't work when built with Visual Studio 2022 and run on Windows 7
Issue #3166: converting UCN to execution character set: Invalid or incomplete multibyte or wide character
Issue #3101: MDC ignores SPDLOG_NO_TLS
Issue #3146: For non-SPDLOG_HEADER_ONLY builds enable export attributes for symbols
Issue #3101 (MDC ignores SPDLOG_NO_TLS
)
Issue #3167 (spdlog example project doesn't work with Visual Studio 2022)
Issue #3166 (Invalid or incomplete multibyte or wide character)
This analysis reflects ongoing challenges within the spdlog community while also highlighting active engagement from users seeking solutions to their logging needs.
The analysis covers a total of 10 open pull requests (PRs) from the gabime/spdlog
repository, focusing on various enhancements, bug fixes, and feature additions. The PRs reflect ongoing development efforts aimed at improving functionality, performance, and compatibility of the spdlog logging library.
PR #3128: V2.x - Attribute support
Created by Felix Bruns, this PR introduces attribute support for logging, allowing context to be associated with a logger instance rather than a thread. It addresses the limitations of the existing Mapped Diagnostic Context (MDC) by providing a per-logger attribute map. Notably, it raises concerns about potential race conditions when multiple threads log simultaneously.
PR #3157: Initialize function-local static variables using "T& t = *new T"
Proposed by Lixingcong, this PR aims to improve the initialization of static objects to prevent segmentation faults. However, it has led to memory leak issues that need addressing.
PR #3155: android: Support __android_log_write_log_message based logging
Jaroslaw Pelczar's PR adds support for a new Android logging API introduced in API Level 30. The implementation is marked by concerns over code complexity due to conditional compilation directives.
PR #3132: Clear previous background color for win32 console before setting new one
Alexey Sinitskikh proposes changes to ensure that the background color in the Win32 console is reset appropriately before applying new settings. The necessity of this change was questioned by Gabi Melman.
PR #3017: Added relay_sink
This PR introduces a relay_sink
that allows rerouting log messages from multiple loggers through a single logger instance. It is particularly useful for applications using DLLs.
PR #2935: async_msg
: take ownership of filename/funcname
Tim Blechmann's PR addresses issues with async logging where filename and function name pointers may become invalid. It introduces an API to take ownership of these strings.
PR #2895: Hide non-API functions
Uri Simchoni's PR proposes hiding non-API functions in shared library builds to improve encapsulation and reduce symbol export clutter.
PR #2819: implemented async_logger::sync() to solve issue #1696
This PR allows users to wait for the completion of logging in asynchronous contexts, ensuring that log messages are processed before proceeding.
PR #2729: Adding minute_file_sink_mt
Proposed by mmanoj, this PR introduces a sink for logging that rotates files every minute. It has faced scrutiny regarding its implementation logic and naming conventions.
PR #2667: Using std::source_location
Gianluca Martino's PR seeks to integrate C++20's std::source_location
into spdlog, enhancing debugging capabilities but introducing potential breaking changes.
The current set of open pull requests showcases a variety of enhancements aimed at improving both the functionality and usability of the spdlog library. A recurring theme across several PRs is the introduction of new features that enhance logging capabilities in multi-threaded environments. For instance, PR #3128 focuses on adding attribute support which allows contextual information to be logged without being tied to specific threads. This is particularly relevant for applications that handle multiple concurrent requests, such as web servers.
However, this enhancement also brings forth concerns regarding race conditions when multiple threads interact with shared loggers. The discussions around this PR highlight a philosophical dilemma within logging libraries—whether to prioritize thread-local storage or logger-instance-based context management. This indicates an ongoing need for careful consideration of concurrency issues in logging frameworks.
Another notable aspect is the introduction of new sinks and enhancements aimed at specific platforms or use cases, such as the Android logging support in PR #3155 and the minute file sink in PR #2729. These additions reflect an active effort to make spdlog more versatile across different environments while catering to specific user needs.
The presence of unresolved issues related to memory management in PR #3157 and potential complexity introduced by conditional compilation in PR #3155 suggests that while feature expansion is critical, it must be balanced against maintainability and performance considerations. For example, Lixingcong's approach to initializing static variables has led to memory leaks, indicating that developers must remain vigilant about resource management as they implement new features.
Moreover, there are indications of community engagement and feedback loops within these discussions. Comments from contributors like Gabi Melman provide insights into best practices while also raising questions about implementation details—this collaborative environment is essential for refining proposals before merging them into the main branch.
In conclusion, while there is significant progress reflected in these pull requests, challenges around concurrency management, memory safety, and code complexity remain prevalent. The active discussions surrounding these topics suggest a healthy level of scrutiny and collaboration among contributors, which is vital for maintaining the quality and performance standards expected from a widely-used logging library like spdlog.
Eugene Smirnov (esmirno)
[-Werror=suggest-override]
. ansicolor_sink.h
and base_sink.h
with a total of 10 lines modified (5 added, 5 removed).zjyhjqs
/Zc:__cplusplus
and addressing /MP
warnings for clang-cl.Alex Overchenko (AJIOB)
FMT_ENFORCE_COMPILE_STRING
.Ziyao (ziyao233)
format()
method as const.Philippe Vaucher (Silex)
syslog_sink
.Dominik Grabiec (DominikGrabiec)
wincolor_sink
.Gabi Melman (gabime)
The development team is actively engaged in both bug fixes and feature enhancements, with Eugene Smirnov leading recent efforts. The team's collaborative nature is evident in their contributions, which focus on improving compatibility and performance across different platforms. Overall, the project appears to be well-maintained with a clear focus on addressing both immediate issues and long-term enhancements.