diff --git a/src/sysvars.cpp b/src/sysvars.cpp index ad8970c..ba05f87 100644 --- a/src/sysvars.cpp +++ b/src/sysvars.cpp @@ -10,8 +10,8 @@ #include #include -#ifndef TRACE_SYSVARS -# define TRACE_SYSVARS 0 +#ifndef DEBUG_SYSVARS +# define DEBUG_SYSVARS 0 #endif #if not defined(SYSVAR_FILE) @@ -26,19 +26,19 @@ T svGetV(const String & name, const T deflt) File f = USEDFS.open(F(SYSVAR_FILE), "r"); if (f) { JsonDocument doc; - DeserializationError err = deserializeJson(doc, f); + const DeserializationError err = deserializeJson(doc, f); if (err) { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: Deserialize error '%s'", err.c_str()); // wrong JSON file (malformed) + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: Deserialize error '%s'", err.c_str()); // wrong JSON file (malformed) } else { if (!doc.containsKey(name)) { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: Key '%s' not found", name.c_str()); + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: Key '%s' not found", name.c_str()); } else { rv = doc[name].as(); } } } else { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: File not found"); + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: File not found"); } return rv; } @@ -51,19 +51,19 @@ T svGetVFile(const String & name, const String & fname, const T deflt) if (f) { JsonDocument doc; - DeserializationError err = deserializeJson(doc, f); + const DeserializationError err = deserializeJson(doc, f); if (err) { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: Deserialize error '%s'", err.c_str()); // wrong JSON file (malformed) + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: Deserialize error '%s'", err.c_str()); // wrong JSON file (malformed) } else { if (!doc.containsKey(name)) { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: Key '%s' not found", name.c_str()); + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: Key '%s' not found", name.c_str()); } else { rv = doc[name].as(); } } } else { - TRACEPLUS(TRACE_SYSVARS, TRACE_ERROR, "SV: File not found '%s'", fname.c_str()); + TRACEPLUS(DEBUG_SYSVARS, TRACE_ERROR, "SV: File not found '%s'", fname.c_str()); } return rv; } @@ -86,7 +86,7 @@ int svSetV(const String & name, T value) File f = USEDFS.open(F(SYSVAR_FILE), "r"); if (f) { - DeserializationError err = deserializeJson(doc, f); + const DeserializationError err = deserializeJson(doc, f); if (err) { res = SV_DESERIALIZE_ERROR; // wrong (malformed) JSON file } @@ -123,7 +123,7 @@ int svSetVFile(const String & name, T value, const String & fname) File f = USEDFS.open(fname, "r"); if (f) { - DeserializationError err = deserializeJson(doc, f); + const DeserializationError err = deserializeJson(doc, f); if (err) { res = SV_DESERIALIZE_ERROR; // wrong (malformed) JSON file }