From 7df4bbc454edcab75e40e1fd6b231d017ff2f91a Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Fri, 18 Apr 2025 18:09:34 +0200 Subject: [PATCH] Use ESP Logging Macros for i18n --- src/I18n.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/I18n.cpp b/src/I18n.cpp index e7ceee69..10daeb5d 100644 --- a/src/I18n.cpp +++ b/src/I18n.cpp @@ -1,14 +1,16 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (C) 2024 Thomas Basler and others + * Copyright (C) 2024-2025 Thomas Basler and others */ #include "I18n.h" -#include "MessageOutput.h" #include "Utils.h" #include "defaults.h" #include #include +#undef TAG +static const char* TAG = "i18n"; + I18nClass I18n; I18nClass::I18nClass() @@ -61,7 +63,7 @@ void I18nClass::readDisplayStrings( // Deserialize the JSON document const DeserializationError error = deserializeJson(doc, f, DeserializationOption::Filter(filter)); if (error) { - MessageOutput.printf("Failed to read file %s\n", filename.c_str()); + ESP_LOGE(TAG, "Failed to read file %s", filename.c_str()); f.close(); return; } @@ -114,7 +116,7 @@ void I18nClass::readLangPacks() while (file != "") { if (file.endsWith(LANG_PACK_SUFFIX)) { - MessageOutput.printf("Read File %s\n", file.c_str()); + ESP_LOGI(TAG, "Read File %s", file.c_str()); readConfig(file); } file = root.getNextFileName(); @@ -134,7 +136,7 @@ void I18nClass::readConfig(String file) // Deserialize the JSON document const DeserializationError error = deserializeJson(doc, f, DeserializationOption::Filter(filter)); if (error) { - MessageOutput.printf("Failed to read file %s\n", file.c_str()); + ESP_LOGE(TAG, "Failed to read file %s", file.c_str()); f.close(); return; } @@ -151,7 +153,7 @@ void I18nClass::readConfig(String file) if (lang.code != "" && lang.name != "") { _availLanguages.push_back(lang); } else { - MessageOutput.printf("Invalid meta data\n"); + ESP_LOGE(TAG, "Invalid meta data"); } f.close();