Repository navigation
refactor: drop the defmt mirrors the log macros now cover (#352, 3/3) - #360
Merged
Merged
Conversation
Since the `log_*!` macros forward to defmt (#359), a hand-written `#[cfg(feature = "defmt")] defmt::…!` next to a `log_*!` line logs the same event twice on the device. Removes the seven such pairs: three in `aimdb-core`'s router, one in its session client (mirror gap), three in the MQTT connector's embedded backend (qos=2 caps, oversized publish). The device now shows the `log_*!` text, which some of the mirrors had shortened. The defmt-only calls stay: they have no `log_*!` counterpart (the MQTT embedded backend's connect/TLS/SNTP lines, the Embassy adapter's runtime logger and slot error). Part of #352. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YPDjQ947yKjLLAq3Xzgu3e
3 of 5 tasks
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.
Description
PR 3 of 3 into
feat/352-log-defmtfor #352. Since PR 2 (#359), thelog_*!macros forward todefmt. A hand-written#[cfg(feature = "defmt")] defmt::…!next to alog_*!line therefore logs the same event twice on the device.Removed: the 7 real pairs (
defmtmirror right after alog_*!call, same event and arguments):aimdb-core/src/router.rs(3)aimdb-core/src/session/client.rs(1)aimdb-mqtt-connector/src/embedded/mod.rs(2)qos=2, capped at 1aimdb-mqtt-connector/src/embedded/session_loop.rs(1)Some of the mirrors had shortened the text. The device now shows the full
log_*!text, which costs no flash at runtime becausedefmtinterns its strings.Kept on purpose: the standalone
defmtcalls with nolog_*!counterpart, which are the only output for their events: the MQTT connector's embedded backend (connect, TLS, SNTP, session errors, …) and the Embassy adapter (runtime logger, slot error). #352 estimated "30 mirrors", but that counted every directdefmtcall; only these 7 are duplicates. Turning the standalone calls intolog_*!(so they'd also show up in host builds of the embedded backend) would be a separate change.Live on the NUCLEO-H563ZI (feature branch with PR 1–3; temporarily with a TCP server on port 0 and a record without a free slot). Everything that used to be invisible shows up in the device's
defmtlog:The summary for 1,000 attempts doesn't appear. The unit test from #351 covers that logic; the likely cause is
defmt-rttdropping lines when its buffer fills during the startup burst. Afterwards the board was flashed back to the clean demo.Verified locally: all 58 Makefile commands for
aimdb-coreandaimdb-mqtt-connector(tests, clippy, everythumbv7emcheck/clippy, includingdefmtand TLS).Afterwards: changelogs on the feature branch, then the PR to
main, the first full CI run over #352.Related Issue
🤖 Generated with Claude Code
https://claude.ai/code/session_01YPDjQ947yKjLLAq3Xzgu3e