Skip to content

fix(wlan): replace Serial.print/printf with ArduinoLog in Wlan.cpp #240

@Phantomias2006

Description

@Phantomias2006

Problem

Wlan.cpp uses Serial.printf/Serial.println for debug output in 13+ locations, violating the project convention that logging must use ArduinoLog macros (Log.verbose, Log.notice, Log.error). Only a single Log.notice call existed (line 391) while all other log statements bypassed the logging framework entirely.

Root Cause

The file predates the ArduinoLog convention and was never migrated. Serial calls bypass log-level filtering, making it impossible to suppress verbose output in production without modifying code.

Fix

Replace all Serial.print/printf/println calls with appropriate ArduinoLog macros:

  • Error/invalid-input messages → Log.warning / Log.error
  • Informational (AP started, WiFi connected) → Log.notice
  • Debug details (SSID, credential load/save) → Log.verbose
  • Redundant Serial calls where a Log.notice already existed → removed

Review-Finding: CR-003-011
Severity: LOW

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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