refactor(Logging): calibrate default levels and reduce playback noise
Serial default VERBOSE→INFO, MQTT default NONE→WARNING, SD NONE→WARNING. Per-subsystem MQTT caps added in CommunicationRouter: BellEngine/ OutputManager/HealthMonitor/ConfigManager at WARNING to silence per-note and per-poll spam; Player/Telemetry/OTAManager at INFO to keep state transitions visible. Remove early Logging::setLevel() call in main.cpp — CommunicationRouter applies all three channels once the MQTT callback is wired. Loop heartbeat downgraded DEBUG→VERBOSE. HealthMonitor polling noise (skipping/performing lines) removed; subsystem status and completion lines VERBOSE→DEBUG. FirmwareValidator boot-path checks VERBOSE→INFO (one-shot, worth seeing). ConfigManager isHealthy() false-branches and NVS read trace VERBOSE→DEBUG. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -229,7 +229,7 @@ String ConfigManager::readNVSString(const char* key, const String& defaultValue)
|
||||
String result = String(buffer);
|
||||
delete[] buffer;
|
||||
|
||||
LOG_VERBOSE(TAG, "ConfigManager - Read NVS key '%s': %s", key, result.c_str());
|
||||
LOG_DEBUG(TAG, "ConfigManager - NVS key '%s': %s", key, result.c_str());
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -328,23 +328,23 @@ bool ConfigManager::loadDeviceConfig() {
|
||||
bool ConfigManager::isHealthy() const {
|
||||
#if HAS_SD_CARD
|
||||
if (!sdInitialized) {
|
||||
LOG_VERBOSE(TAG, "ConfigManager - ⚠️ Unhealthy - SD card not initialized");
|
||||
LOG_DEBUG(TAG, "ConfigManager - Unhealthy: SD card not initialized");
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (deviceConfig.serial.isEmpty()) {
|
||||
LOG_VERBOSE(TAG, "ConfigManager - ⚠️ Unhealthy - Serial not set (factory configuration required)");
|
||||
LOG_DEBUG(TAG, "ConfigManager - Unhealthy: Serial not set (factory configuration required)");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (deviceConfig.hwFamily.isEmpty()) {
|
||||
LOG_VERBOSE(TAG, "ConfigManager - ⚠️ Unhealthy - HW family not set (factory configuration required)");
|
||||
LOG_DEBUG(TAG, "ConfigManager - Unhealthy: HW family not set (factory configuration required)");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (networkConfig.hostname.isEmpty()) {
|
||||
LOG_VERBOSE(TAG, "ConfigManager - ⚠️ Unhealthy - Hostname not generated (initialization issue)");
|
||||
LOG_DEBUG(TAG, "ConfigManager - Unhealthy: Hostname not generated (initialization issue)");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -523,7 +523,7 @@ void ConfigManager::updateBellOutputs(JsonVariant doc) {
|
||||
String key = String("b") + (i + 1);
|
||||
if (doc.containsKey(key)) {
|
||||
bellConfig.outputs[i] = doc[key].as<uint16_t>() - 1;
|
||||
LOG_VERBOSE(TAG, "ConfigManager - Bell %d output set to %d", i + 1, bellConfig.outputs[i]);
|
||||
LOG_DEBUG(TAG, "ConfigManager - Bell %d output set to %d", i + 1, bellConfig.outputs[i]);
|
||||
}
|
||||
}
|
||||
LOG_DEBUG(TAG, "ConfigManager - Updated bell outputs");
|
||||
@@ -576,7 +576,7 @@ void ConfigManager::saveFileToSD(const char* dirPath, const char* filename, cons
|
||||
|
||||
file.print(data);
|
||||
file.close();
|
||||
LOG_VERBOSE(TAG, "ConfigManager - File %s saved successfully", fullPath.c_str());
|
||||
LOG_DEBUG(TAG, "ConfigManager - File %s saved successfully", fullPath.c_str());
|
||||
}
|
||||
|
||||
// Clock configuration methods and other remaining methods follow the same pattern...
|
||||
@@ -817,7 +817,7 @@ bool ConfigManager::saveClockState() {
|
||||
}
|
||||
|
||||
saveFileToSD("/settings", "clockState.json", buffer);
|
||||
LOG_VERBOSE(TAG, "ConfigManager - Clock state saved");
|
||||
LOG_DEBUG(TAG, "ConfigManager - Clock state saved");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1180,7 +1180,7 @@ bool ConfigManager::resetAllToDefaults() {
|
||||
|
||||
if (SD.exists(filepath)) {
|
||||
if (SD.remove(filepath)) {
|
||||
LOG_VERBOSE(TAG, "ConfigManager - ✅ Deleted: %s", filepath);
|
||||
LOG_DEBUG(TAG, "ConfigManager - Deleted: %s", filepath);
|
||||
filesDeleted++;
|
||||
} else {
|
||||
LOG_ERROR(TAG, "ConfigManager - ❌ Failed to delete: %s", filepath);
|
||||
@@ -1188,7 +1188,7 @@ bool ConfigManager::resetAllToDefaults() {
|
||||
allDeleted = false;
|
||||
}
|
||||
} else {
|
||||
LOG_VERBOSE(TAG, "ConfigManager - Skip (not found): %s", filepath);
|
||||
LOG_DEBUG(TAG, "ConfigManager - Skip (not found): %s", filepath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1210,7 +1210,7 @@ bool ConfigManager::resetAllToDefaults() {
|
||||
|
||||
if (!entry.isDirectory()) {
|
||||
if (SD.remove(entryPath.c_str())) {
|
||||
LOG_VERBOSE(TAG, "ConfigManager - ✅ Deleted melody: %s", entryPath.c_str());
|
||||
LOG_DEBUG(TAG, "ConfigManager - Deleted melody: %s", entryPath.c_str());
|
||||
melodiesDeleted++;
|
||||
} else {
|
||||
LOG_ERROR(TAG, "ConfigManager - ❌ Failed to delete melody: %s", entryPath.c_str());
|
||||
@@ -1227,7 +1227,7 @@ bool ConfigManager::resetAllToDefaults() {
|
||||
|
||||
// Try to remove the empty directory
|
||||
if (SD.rmdir("/melodies")) {
|
||||
LOG_VERBOSE(TAG, "ConfigManager - ✅ Deleted /melodies directory");
|
||||
LOG_DEBUG(TAG, "ConfigManager - Deleted /melodies directory");
|
||||
} else {
|
||||
LOG_WARNING(TAG, "ConfigManager - ⚠️ Could not delete /melodies directory (may not be empty)");
|
||||
}
|
||||
@@ -1237,7 +1237,7 @@ bool ConfigManager::resetAllToDefaults() {
|
||||
filesFailed += melodiesFailed;
|
||||
}
|
||||
} else {
|
||||
LOG_VERBOSE(TAG, "ConfigManager - /melodies directory not found");
|
||||
LOG_DEBUG(TAG, "ConfigManager - /melodies directory not found");
|
||||
}
|
||||
|
||||
// ════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
Reference in New Issue
Block a user