Consolidate logging output behind spdlog backend#180
Closed
VolkerChristian wants to merge 1 commit into
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
spdlog, butLogger.cppmixed backend state and sink setup with the semantic and legacy logging facade making the implementation hard to maintain.spdlogowns how/where already-formatted lines are emitted while SNode.C keeps owning semantic policy, formatting and public API.Description
logger::detail::SpdlogBackend(header + implementation) and moved stdout/file sinks, rotating file setup, tick formatting, quiet/color state, and backend logger ownership into it (src/log/detail/SpdlogBackend.h,src/log/detail/SpdlogBackend.cpp).Logger.cppinto a stable facade that delegates initialization, tick resolver, quiet/color toggles, file enable/disable, legacy emission and level/verbose checks to the backend while preservingLogManager/LogRecordsemantics and public APIs.LogManager::shouldEmit()andLogManager::formatRecord()in the semantic layer and passing the already-formatted semantic line to the backend for emission.src/log/CMakeLists.txtto compile and install the new backend source/header and retained synchronous emission (no async mode introduced).Testing
cmake -S . -B cmake-buildwhich configured the project successfully.cmake --build cmake-build --parallel 2which built the project successfully.ctest --test-dir cmake-build -R "Log|Semantic" --output-on-failurewhich executed and reportedNo tests were found!!!for the focused logging regex.ctest --test-dir cmake-build --output-on-failurewhich executed and reportedNo tests were found!!!for the full test run in this build tree.git diff --checkto validate whitespace and patch issues and it returned clean.clang-format -i src/log/Logger.cpp src/log/detail/SpdlogBackend.cpp src/log/detail/SpdlogBackend.hto format touched files.Codex Task