Replace Serial.* logging with ESP_LOG* macros (issue #8) #12

Merged
eddy merged 2 commits from fix/issue-8-cleanup-logging into main 2026-08-02 20:57:41 +02:00
Owner

Summary

Replaces all Serial.println/Serial.printf debug logging with ESP_LOG* macros (ESP_LOGE, ESP_LOGW, ESP_LOGI, ESP_LOGD).

Changes

  • main.cpp: All debug logging → ESP_LOG* with TAG="server"
  • client.cpp: All debug logging → ESP_LOG* with TAG="client"
  • platformio.ini: CORE_DEBUG_LEVEL lowered from 5 (verbose) to 3 (warn) for production
  • USB serial protocol commands (KEY?, VERSION?, SET_KEY:, etc.) remain Serial.printf — that is communication protocol, not logging

Why

  • Excessive Serial.println spam on serial monitor made protocol output unreadable
  • ESP_LOG* supports log levels, filtering, and per-tag control
  • Production builds now only show warnings/errors by default
  • Debug output still available by raising CORE_DEBUG_LEVEL

Closes #8

## Summary Replaces all `Serial.println`/`Serial.printf` debug logging with `ESP_LOG*` macros (`ESP_LOGE`, `ESP_LOGW`, `ESP_LOGI`, `ESP_LOGD`). ### Changes - **main.cpp**: All debug logging → `ESP_LOG*` with `TAG="server"` - **client.cpp**: All debug logging → `ESP_LOG*` with `TAG="client"` - **platformio.ini**: `CORE_DEBUG_LEVEL` lowered from 5 (verbose) to 3 (warn) for production - USB serial protocol commands (`KEY?`, `VERSION?`, `SET_KEY:`, etc.) remain `Serial.printf` — that is communication protocol, not logging ### Why - Excessive `Serial.println` spam on serial monitor made protocol output unreadable - `ESP_LOG*` supports log levels, filtering, and per-tag control - Production builds now only show warnings/errors by default - Debug output still available by raising `CORE_DEBUG_LEVEL` Closes #8
Replace Serial.* logging with ESP_LOG* macros (issue #8)
All checks were successful
CI / firmware (pull_request) Successful in 1m21s
CI / android (pull_request) Successful in 7s
32489fbabb
- Convert all Serial.println/printf debug logging to ESP_LOGE/W/I/D
- Add TAG-based log identification (server/client)
- Lower CORE_DEBUG_LEVEL from 5 to 3 for production
- Keep Serial.printf for USB serial protocol commands (KEY?, VERSION?, etc.)
Review fixes: Serial ERROR→ESP_LOGE, heartbeat→ESP_LOGD
All checks were successful
CI / firmware (pull_request) Successful in 1m26s
CI / android (pull_request) Successful in 5s
4aa2a750d9
- Replace remaining Serial.println("ERROR:...") with ESP_LOGE in client.cpp
- Add Serial.println("ERROR") for protocol response where needed
- Downgrade heartbeat from ESP_LOGI to ESP_LOGD (not needed in production)
eddy merged commit f8d4e96241 into main 2026-08-02 20:57:41 +02:00
Sign in to join this conversation.
No description provided.