Skip to content

Consolidate duplicate Q_LOGGING_CATEGORY declarations for "aether.ax25" #2763

Description

@ten9876

Context

PR #2753 landed AetherModem Phase 0 — AX.25 HF packet decode. During review I noticed the new code declares the "aether.ax25" Qt logging category twice with two different C++ symbol names:

  • src/core/LogManager.cpp:36Q_LOGGING_CATEGORY(lcAx25, "aether.ax25", QtWarningMsg) — the centralized declaration that participates in the LogManager registry and surfaces in the Help → Support log-toggles UI.
  • src/core/tnc/AetherAx25LibmodemShim.cpp:18Q_LOGGING_CATEGORY(lcAetherAx25Shim, "aether.ax25") — a local re-declaration used only inside the shim's qCDebug callsites.

Qt resolves both lcAx25 and lcAetherAx25Shim to the same underlying QLoggingCategory instance at runtime (because both register the string "aether.ax25"), so the duplication is functionally harmless today. But it's a latent anti-pattern:

  • Two C++ symbols pointing at one runtime category is confusing for anyone reading the code.
  • The shim's local declaration sits outside the LogManager registry, which means if someone ever needs to enumerate "what does AetherSDR log under?" they'd miss the shim's intent unless they grep for the string literal.
  • A future change to the LogManager category metadata (default level, on/off toggle hook) only applies to lcAx25; the shim would silently diverge.

What to do

Replace the local Q_LOGGING_CATEGORY in AetherAx25LibmodemShim.cpp with a #include "core/LogManager.h" and switch all qCDebug(lcAetherAx25Shim) callsites to qCDebug(lcAx25). Five callsites in that file based on grep:

src/core/tnc/AetherAx25LibmodemShim.cpp:316:    qCDebug(lcAetherAx25Shim).nospace()
src/core/tnc/AetherAx25LibmodemShim.cpp:347:    qCDebug(lcAetherAx25Shim).nospace()
src/core/tnc/AetherAx25LibmodemShim.cpp:695:    qCDebug(lcAetherAx25Shim).noquote()
src/core/tnc/AetherAx25LibmodemShim.cpp:707:    qCDebug(lcAetherAx25Shim).nospace()

(plus the declaration itself on line 18)

Acceptance criteria

  • grep -rn "Q_LOGGING_CATEGORY.*aether.ax25" src/ returns exactly one hit (in LogManager.cpp).
  • grep -rn "lcAetherAx25Shim" src/ returns zero hits.
  • All previous qCDebug(lcAetherAx25Shim) callsites use lcAx25 and #include "core/LogManager.h" is present.
  • Behavior unchanged — same log messages at same levels, same toggle in Help → Support.

Pickup

Mechanical, single-file refactor. AetherClaude-eligible.

73, Jeremy KK7GWY & Claude (AI dev partner)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to existing featuregood first issueGood for newcomersmaintainer-reviewRequires maintainer review before any action is takenrefactorCode cleanup, restructuring, or consolidation — no user-visible behavior change

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions