From ffd3a4bff3b9c675572b2f882e3f0de11f8a144e Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 13 Oct 2026 17:03:29 +0200 Subject: [PATCH] feat: add quill logger * create logger for each subsystem * replace all couts and cerrs with logger * fix failing tests --- CLAUDE.md | 12 +- README.md | 35 ++++- cmake/Dependencies.cmake | 14 +- include/logging/Logging.hpp | 39 ++++++ include/parser/Parser.hpp | 2 +- include/scene/SceneObject.hpp | 1 - include/scene/components/BlinkComponent.hpp | 2 - src/CMakeLists.txt | 2 + src/Runtime.cpp | 11 +- src/logging/CMakeLists.txt | 7 + src/logging/Logging.cpp | 133 ++++++++++++++++++ src/lslreader/CMakeLists.txt | 2 + src/lslreader/LSLReader.cpp | 15 +- src/main.cpp | 29 +++- src/parser/CMakeLists.txt | 3 +- src/parser/Parser.cpp | 9 ++ src/scene/SceneObject.cpp | 4 +- tests/CMakeLists.txt | 6 +- tests/cli_tests/CMakeLists.txt | 24 ++++ tests/component_tests/CMakeLists.txt | 2 +- tests/unit_tests/CMakeLists.txt | 2 +- tests/unit_tests/logging_test.cpp | 49 +++++++ tests/unit_tests/lslreader_test.cpp | 144 ++++++++++---------- tests/utils/TestMain.cpp | 9 ++ 24 files changed, 452 insertions(+), 104 deletions(-) create mode 100644 include/logging/Logging.hpp create mode 100644 src/logging/CMakeLists.txt create mode 100644 src/logging/Logging.cpp create mode 100644 tests/cli_tests/CMakeLists.txt create mode 100644 tests/unit_tests/logging_test.cpp create mode 100644 tests/utils/TestMain.cpp diff --git a/CLAUDE.md b/CLAUDE.md index d056b2a..d2431f4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,10 +5,13 @@ You are in the **runtime** repo. Read the system overview below first. ## This repo - Build: `cmake -B build && cmake --build build`. Tests: `cd build && ctest --output-on-failure` - (`-L unit` / `-L component`). Format: `cmake --build build --target format` — CI fails on - unformatted code. + (`-L unit` / `-L component` / `-L cli`). Format: `cmake --build build --target format` — CI + fails on unformatted code. - Layout: `include/` headers, `src/` impl, `src/parser/Parser.cpp` turns a `.neuroz`/`.pb` file - into a `Scene`, `scene/components/` component classes, `tests/{unit,component}_tests/`. + into a `Scene`, `scene/components/` component classes, `tests/{unit,component,cli}_tests/`. +- Logging: `LOG_*(logging::logger(logging::Subsystem::…), "…{}", …)` from + `` (Quill, README §3 "Logging"); never `std::cout` / `std::cerr`. + Nothing per frame or per sample. Level: `NEURONIDE_LOG_LEVEL`. - New component: subclass `Component`, add a static creator, and `REGISTER_COMPONENT(NeuronIDE::Component::k, Creator)` in its `.cpp`. The proto oneof entry must exist first — which means a backend change too. @@ -20,7 +23,8 @@ You are in the **runtime** repo. Read the system overview below first. device `config.json` is written by the launcher, which starts the runtime with `[config.json] ` (#31). The output folder comes from `config.json` (`output.directory`), which the launcher sets to each run's own folder; distinct exit codes are part of the same contract, because - the launcher shows them to the experimenter (both in runtime#37). + the launcher shows them to the experimenter (both in runtime#37). Diagnostics go to stderr + as `