Skip to content

fix(log): arm CuemsLogger on the gradient_motion library; route stdio bypasses - #7

Merged
backenv merged 2 commits into
chore/bump-mtcreceiver-24hfrom
fix/library-logging-backend
Jul 30, 2026
Merged

fix(log): arm CuemsLogger on the gradient_motion library; route stdio bypasses#7
backenv merged 2 commits into
chore/bump-mtcreceiver-24hfrom
fix/library-logging-backend

Conversation

@ibiltari

Copy link
Copy Markdown
Member

Stacked on chore/bump-mtcreceiver-24h so the diff is exactly these two commits. Authored branch-only, deliberately not merged and not deployed — active work is ongoing in this repo; merge whenever it suits. Nothing is broken by waiting: the daemon's own logging already reaches syslog with real priorities on the fleet — this PR fixes the library half.

Root cause

HAVE_CUEMS_LOGGER was defined on mtcreceiver and the gradient-motiond executable, but not on the gradient_motion static library. Consequences:

  • every GME_LOG_* compiled into the library fell back to logging.h's std::cerr emitter — under systemd those lines are stamped PRIORITY=6 (info) regardless of severity, so journalctl -p 4 / cuems-logs -e can never surface them;
  • src/engine/GradientEngine.cpp, listed in both targets, was compiled twice with two different logging backends;
  • the unavailable macro layer is why src/motion/*.cpp hand-rolled fprintf(stderr, "WARNING …") lines in the first place.

Changes

  1. src/CMakeLists.txt — define + link CuemsLogger PUBLIC on gradient_motion, guarded by ENABLE_CUEMS_LOGGER AND TARGET cuemslogger (covers BUILD_DAEMON=OFF). PUBLIC kills the dual-backend hazard: daemon and the test binaries share one backend. Known side effect: ctest output goes to syslog when cuemslogger is enabled. The now-redundant PRIVATE arming on the daemon target is dropped.
  2. Hand-rolled stdio → GME_LOG_*: MotionFactory (unknown curve, lo_address_new failure → WARNING; START_CROSSFADE stub → INFO), MotionRegistry (crossfade drop → INFO, cancelMotion miss → WARNING), CurveFactory (unknown curve → WARNING).
  3. OscServer: liblo errorHandler + callback exceptions → GME_LOG_ERROR; the two startup-aborting failures (UDP bind, lo_server_thread_start) → GME_LOG_CRITICAL. These bypassed the GME_LOG_* layer the same file uses everywhere else.
  4. Submodule pins converged on the reconciled shared heads: cuemslogger c39e2d8 → 6463cd9 (master now carries the anton closelog()-in-setNewSlug memory fix — ancestry-gated with git merge-base --is-ancestor 30c9cb4 6463cd9 before any consumer bumped) and mtcreceiver 8a30d05 → 20ab95b (same 24h-continuity line this branch's base tracks, plus a journald-aware fallback stub and the MTC-RX FullFrame diagnostic at debug priority — this repo builds mtcreceiver with HAVE_CUEMS_LOGGER, so it uses the real logger path).

Deliberately untouched: GradientEngine::onTick() (MIDI thread, 100 Hz) — already level-gated and queue-pop-only; nothing new on that path.

Verification

Full build (daemon + tests), ctest 9/9 passed, and libgradient_motion.a now resolves real CuemsLogger symbols. The same journal-priority conversion is already deployed and verified live on the test2 controller for videocomposer/dmxplayer/audioplayer/rtpmidid (context: cuems-RELATIONS/Plans/journal-logging-remaining-repos.md).

ibiltari added 2 commits July 29, 2026 19:43
NOT MERGED, NOT DEPLOYED — authored on a branch for review at your
convenience (active work is ongoing in this repo). gradient-motiond's
daemon-side logging already works on the fleet (syslog, real priorities);
this fixes the LIBRARY half.

Root cause: HAVE_CUEMS_LOGGER was defined on mtcreceiver and the
gradient-motiond executable but NOT on the gradient_motion static library,
so every GME_LOG_* compiled into the library fell back to logging.h's
std::cerr emitter — stamped PRIORITY=6 under systemd, invisible to
`cuems-logs -e` — and GradientEngine.cpp, listed in BOTH targets, compiled
twice with two different logging backends. That unavailable macro layer is
also why src/motion/* hand-rolled fprintf(stderr, "WARNING ...") lines.

* src/CMakeLists.txt: define + link PUBLIC on gradient_motion, guarded by
  ENABLE_CUEMS_LOGGER AND TARGET cuemslogger (covers BUILD_DAEMON=OFF).
  PUBLIC kills the dual-backend hazard: daemon and the test binaries now
  share one backend. Side effect to be aware of: ctest output goes to
  syslog when cuemslogger is enabled.
* Root CMakeLists: drop the now-redundant PRIVATE arming on the daemon
  (it inherits via the library's usage requirements).
* Hand-rolled fprintf/cerr sites -> GME_LOG_*: MotionFactory (unknown
  curve, lo_address_new failure -> WARNING; START_CROSSFADE stub -> INFO),
  MotionRegistry (crossfade drop -> INFO, cancelMotion miss -> WARNING),
  CurveFactory (unknown curve -> WARNING).
* OscServer: liblo errorHandler + callback exceptions -> GME_LOG_ERROR;
  the two startup-aborting failures (UDP bind, lo_server_thread_start) ->
  GME_LOG_CRITICAL. These bypassed the GME_LOG_* layer the same file uses
  everywhere else.
* GradientEngine::onTick (MIDI thread, 100 Hz) deliberately untouched —
  already level-gated and queue-pop-only.

Verified: full build (daemon + tests), ctest 9/9 passed,
libgradient_motion.a now resolves CuemsLogger symbols.
…eads

cuemslogger c39e2d8 -> 6463cd9: master now carries the anton
closelog()-in-setNewSlug memory fix and the audioplayer header fix
(ancestry-gated before any consumer bumped:
git merge-base --is-ancestor 30c9cb4 6463cd9).

mtcreceiver 8a30d05 -> 20ab95b: same 24h-continuity line this branch's base
already tracks, plus the journald-aware fallback stub (with logDebug and a
shared multi-header guard) and the MTC-RX FullFrame diagnostic at debug
priority. This repo builds mtcreceiver with HAVE_CUEMS_LOGGER, so it uses
the real logger path; run ctest after merging as the base branch intended.
@cursor

cursor Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 18.18182% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
daemon/comms/OscServer.cpp 0.00% 5 Missing ⚠️
src/motion/MotionFactory.cpp 33.33% 2 Missing ⚠️
src/motion/MotionRegistry.cpp 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@backenv
backenv merged commit 2554de5 into chore/bump-mtcreceiver-24h Jul 30, 2026
3 of 4 checks passed
backenv added a commit that referenced this pull request Jul 30, 2026
Release v0.3.1 — fix OSC send-failure misclassification, arm CuemsLogger on the library, converge submodules

Full description in the PR description, summary included below:

  - Leads with the T069 bug, stated in user-visible terms ("every fade longer than ~25 ms was silently
  killed mid-flight") rather than as a diff description. That's the one item in the branch with production
  impact, and it's the reason the release exists.
  - Groups the 17 commits into five themes rather than listing them, since several are merges and reverts
  that cancel out and would just add noise.
  - Flags one behavioral surprise for reviewers: PR #7's PUBLIC arming means ctest output now goes to
  syslog when cuemslogger is enabled. It's intended, but it changes local test ergonomics and would
  otherwise be discovered the confusing way.
  - Documents both submodule bumps as fast-forwards with a table, and verified that claim (c39e2d8 and
  59fc76e are both strict ancestors of the new pins). Reviewers usually want to know a submodule bump
  can't lose commits — worth stating explicitly. Note this is how main picks up the >24h MTC work and the
  aa44894 resync fix.
  - Calls out the dead -DBUILD_TESTS=OFF flag explicitly — it means every prior packaging build compiled
  the full test suite, which is a fact about past builds, not just a code change.
  - Notes T070 is planning-only, so nobody reviews it expecting workflow files.
  - Closes with two practical notes: the stale 0.3.1-1 artifact that predates the logging fix, and the
  duplicated docs commit SHA from the rebase — with a squash-merge suggestion, since that duplication is
  the one thing likely to make a reviewer stop and squint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants