mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
tidy up EMSESP_DEBUG
This commit is contained in:
@@ -26,11 +26,11 @@ class FSPersistence {
|
||||
if (error == DeserializationError::Ok && jsonDocument.is<JsonObject>()) {
|
||||
JsonObject jsonObject = jsonDocument.as<JsonObject>();
|
||||
_statefulService->updateWithoutPropagation(jsonObject, _stateUpdater);
|
||||
#ifdef EMSESP_DEBUG
|
||||
Serial.println();
|
||||
Serial.printf("Reading settings from %s ", _filePath);
|
||||
serializeJson(jsonDocument, Serial);
|
||||
Serial.println();
|
||||
#if defined(EMSESP_DEBUG)
|
||||
// Serial.println();
|
||||
// Serial.printf("Reading settings from %s ", _filePath);
|
||||
// serializeJson(jsonDocument, Serial);
|
||||
// Serial.println();
|
||||
#endif
|
||||
settingsFile.close();
|
||||
return;
|
||||
@@ -40,10 +40,10 @@ class FSPersistence {
|
||||
|
||||
// If we reach here we have not been successful in loading the config,
|
||||
// hard-coded emergency defaults are now applied.
|
||||
#ifdef EMSESP_DEBUG
|
||||
Serial.println();
|
||||
Serial.printf("Applying defaults to %s", _filePath);
|
||||
Serial.println();
|
||||
#if defined(EMSESP_DEBUG)
|
||||
// Serial.println();
|
||||
// Serial.printf("Applying defaults to %s", _filePath);
|
||||
// Serial.println();
|
||||
#endif
|
||||
applyDefaults();
|
||||
writeToFS(); // added to make sure the initial file is created
|
||||
@@ -74,11 +74,11 @@ class FSPersistence {
|
||||
}
|
||||
|
||||
// serialize the data to the file
|
||||
#ifdef EMSESP_DEBUG
|
||||
Serial.println();
|
||||
Serial.printf("Writing settings to %s ", _filePath);
|
||||
serializeJson(jsonDocument, Serial);
|
||||
Serial.println();
|
||||
#if defined(EMSESP_DEBUG)
|
||||
// Serial.println();
|
||||
// Serial.printf("Writing settings to %s ", _filePath);
|
||||
// serializeJson(jsonDocument, Serial);
|
||||
// Serial.println();
|
||||
#endif
|
||||
serializeJson(jsonDocument, settingsFile);
|
||||
settingsFile.close();
|
||||
|
||||
Reference in New Issue
Block a user