diff options
author | saturneric <[email protected]> | 2024-01-05 12:55:15 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-01-05 12:55:15 +0000 |
commit | 644aa4397b03dbef73f8bfedc13925b51cad836b (patch) | |
tree | 7788d1cd2f0687dd8e576b111d9990c580092e7a /src/ui/struct | |
parent | fix: slove some known issues (diff) | |
download | GpgFrontend-644aa4397b03dbef73f8bfedc13925b51cad836b.tar.gz GpgFrontend-644aa4397b03dbef73f8bfedc13925b51cad836b.zip |
feat: integrate logging api to core
Diffstat (limited to 'src/ui/struct')
-rw-r--r-- | src/ui/struct/SettingsObject.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ui/struct/SettingsObject.cpp b/src/ui/struct/SettingsObject.cpp index 4b60410c..cf11fc5e 100644 --- a/src/ui/struct/SettingsObject.cpp +++ b/src/ui/struct/SettingsObject.cpp @@ -32,7 +32,7 @@ nlohmann::json& GpgFrontend::UI::SettingsObject::Check( const std::string& key, const nlohmann::json& default_value) { // check if the self null if (this->nlohmann::json::is_null()) { - SPDLOG_DEBUG("settings object is null, creating new one"); + GF_UI_LOG_DEBUG("settings object is null, creating new one"); this->nlohmann::json::operator=(nlohmann::json::object()); } @@ -41,9 +41,9 @@ nlohmann::json& GpgFrontend::UI::SettingsObject::Check( this->nlohmann::json::at(key).is_null() || this->nlohmann::json::at(key).type_name() != default_value.type_name()) { - SPDLOG_DEBUG("added missing key: {}", key); + GF_UI_LOG_DEBUG("added missing key: {}", key); if (default_value.is_null()) { - SPDLOG_WARN("default value is null, using empty object"); + GF_UI_LOG_WARN("default value is null, using empty object"); this->nlohmann::json::operator[](key) = nlohmann::json::object(); } else { this->nlohmann::json::operator[](key) = default_value; @@ -51,7 +51,7 @@ nlohmann::json& GpgFrontend::UI::SettingsObject::Check( } return this->nlohmann::json::at(key); } catch (nlohmann::json::exception& e) { - SPDLOG_ERROR(e.what()); + GF_UI_LOG_ERROR(e.what()); throw e; } } @@ -60,14 +60,14 @@ GpgFrontend::UI::SettingsObject GpgFrontend::UI::SettingsObject::Check( const std::string& key) { // check if the self null if (this->nlohmann::json::is_null()) { - SPDLOG_DEBUG("settings object is null, creating new one"); + GF_UI_LOG_DEBUG("settings object is null, creating new one"); this->nlohmann::json::operator=(nlohmann::json::object()); } if (!nlohmann::json::contains(key) || this->nlohmann::json::at(key).is_null() || this->nlohmann::json::at(key).type() != nlohmann::json::value_t::object) { - SPDLOG_DEBUG("added missing key: {}", key); + GF_UI_LOG_DEBUG("added missing key: {}", key); this->nlohmann::json::operator[](key) = nlohmann::json::object(); } return SettingsObject{nlohmann::json::operator[](key), false}; @@ -76,21 +76,21 @@ GpgFrontend::UI::SettingsObject GpgFrontend::UI::SettingsObject::Check( GpgFrontend::UI::SettingsObject::SettingsObject(std::string settings_name) : settings_name_(std::move(settings_name)) { try { - SPDLOG_DEBUG("loading settings from: {}", this->settings_name_); + GF_UI_LOG_DEBUG("loading settings from: {}", this->settings_name_); auto _json_optional = GpgFrontend::DataObjectOperator::GetInstance().GetDataObject( settings_name_); if (_json_optional.has_value()) { - SPDLOG_DEBUG("settings object: {} loaded.", settings_name_); + GF_UI_LOG_DEBUG("settings object: {} loaded.", settings_name_); nlohmann::json::operator=(_json_optional.value()); } else { - SPDLOG_DEBUG("settings object: {} not found.", settings_name_); + GF_UI_LOG_DEBUG("settings object: {} not found.", settings_name_); nlohmann::json::operator=({}); } } catch (std::exception& e) { - SPDLOG_ERROR(e.what()); + GF_UI_LOG_ERROR(e.what()); } } |