overmatig debug logging opschonen #8

Closed
opened 2026-08-01 23:24:19 +02:00 by eddy · 1 comment
Owner

tijden de dev fase is er veel logging gebruikt. Goed gedaan.
Nu we rc beginnen te naderen mag de logging worden nagelopen zodat overmatig loggen wordt gelimineerd

tijden de dev fase is er veel logging gebruikt. Goed gedaan. Nu we rc beginnen te naderen mag de logging worden nagelopen zodat overmatig loggen wordt gelimineerd
Author
Owner

Opgelost in PR #12.

Wat is er gedaan

  • Alle Serial.println/Serial.printf debug logging vervangen door ESP_LOG* macros (ESP_LOGE, ESP_LOGW, ESP_LOGI, ESP_LOGD)
  • TAG-based filtering: TAG="server" (main.cpp) en TAG="client" (client.cpp)
  • CORE_DEBUG_LEVEL verlaagd van 5 (verbose) naar 3 (warn) — productie toont alleen E/W/I
  • USB serial protocol regels (KEY?, VERSION?, SET_KEY:, OK, ERROR, etc.) blijven Serial.printf — dat is communicatieprotocol, geen logging
  • Foutmeldingen (ERROR: invalid key format, etc.) nu ESP_LOGE + protocol response Serial.println("ERROR")
  • Heartbeat downgraded naar ESP_LOGD — alleen zichtbaar met CORE_DEBUG_LEVEL>=4
  • Oude overbodige debug output verwijderd (button press log, OTA chunk timing, advertising details)

Log level indeling

Level Gebruikt voor
ESP_LOGE HMAC mismatch, OTA errors, invalid provisioning input
ESP_LOGW BLE disconnect, replay rejection, no HMAC key, UUID mismatch
ESP_LOGI BLE connect, relay state changes, setup status, OTA status
ESP_LOGD UUID hex dumps, heartbeat, OTA internals, scan details
Opgelost in PR #12. ### Wat is er gedaan - Alle `Serial.println`/`Serial.printf` debug logging vervangen door `ESP_LOG*` macros (`ESP_LOGE`, `ESP_LOGW`, `ESP_LOGI`, `ESP_LOGD`) - TAG-based filtering: `TAG="server"` (main.cpp) en `TAG="client"` (client.cpp) - `CORE_DEBUG_LEVEL` verlaagd van 5 (verbose) naar 3 (warn) — productie toont alleen E/W/I - USB serial protocol regels (`KEY?`, `VERSION?`, `SET_KEY:`, `OK`, `ERROR`, etc.) blijven `Serial.printf` — dat is communicatieprotocol, geen logging - Foutmeldingen (`ERROR: invalid key format`, etc.) nu `ESP_LOGE` + protocol response `Serial.println("ERROR")` - Heartbeat downgraded naar `ESP_LOGD` — alleen zichtbaar met `CORE_DEBUG_LEVEL>=4` - Oude overbodige debug output verwijderd (button press log, OTA chunk timing, advertising details) ### Log level indeling | Level | Gebruikt voor | |-------|---------------| | `ESP_LOGE` | HMAC mismatch, OTA errors, invalid provisioning input | | `ESP_LOGW` | BLE disconnect, replay rejection, no HMAC key, UUID mismatch | | `ESP_LOGI` | BLE connect, relay state changes, setup status, OTA status | | `ESP_LOGD` | UUID hex dumps, heartbeat, OTA internals, scan details |
eddy closed this issue 2026-08-02 20:57:41 +02:00
Sign in to join this conversation.
No description provided.