Skip to content

Consolidate logging output behind spdlog backend#180

Closed
VolkerChristian wants to merge 1 commit into
masterfrom
codex/create-pr-to-consolidate-spdlog-backend
Closed

Consolidate logging output behind spdlog backend#180
VolkerChristian wants to merge 1 commit into
masterfrom
codex/create-pr-to-consolidate-spdlog-backend

Conversation

@VolkerChristian

Copy link
Copy Markdown
Member

Motivation

  • SNode.C already uses spdlog, but Logger.cpp mixed backend state and sink setup with the semantic and legacy logging facade making the implementation hard to maintain.
  • Introduce a clear backend boundary so spdlog owns how/where already-formatted lines are emitted while SNode.C keeps owning semantic policy, formatting and public API.

Description

  • Added an internal backend abstraction 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).
  • Simplified Logger.cpp into a stable facade that delegates initialization, tick resolver, quiet/color toggles, file enable/disable, legacy emission and level/verbose checks to the backend while preserving LogManager/LogRecord semantics and public APIs.
  • Preserved semantic behavior by keeping LogManager::shouldEmit() and LogManager::formatRecord() in the semantic layer and passing the already-formatted semantic line to the backend for emission.
  • Updated src/log/CMakeLists.txt to compile and install the new backend source/header and retained synchronous emission (no async mode introduced).

Testing

  • Ran cmake -S . -B cmake-build which configured the project successfully.
  • Ran cmake --build cmake-build --parallel 2 which built the project successfully.
  • Ran ctest --test-dir cmake-build -R "Log|Semantic" --output-on-failure which executed and reported No tests were found!!! for the focused logging regex.
  • Ran ctest --test-dir cmake-build --output-on-failure which executed and reported No tests were found!!! for the full test run in this build tree.
  • Ran git diff --check to validate whitespace and patch issues and it returned clean.
  • Ran clang-format -i src/log/Logger.cpp src/log/detail/SpdlogBackend.cpp src/log/detail/SpdlogBackend.h to format touched files.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant