diff --git a/MigrationPreparer/CHANGELOG.md b/MigrationPreparer/CHANGELOG.md index e81a6361cb..c9f953030e 100644 --- a/MigrationPreparer/CHANGELOG.md +++ b/MigrationPreparer/CHANGELOG.md @@ -14,6 +14,9 @@ All notable changes to this RDK Service will be documented in this file. For more details, refer to versioning section under Main README. +## [1.0.1] - 2025-20-01 +- Changes to avoid any "value" field from getting printed in MigrationPreparer related logs. + ## [1.0.0] - 2024-12-01 ### Added - New RDK Service MigrationPreparer to aid the Data Harvesting process, where it exposes APIs to applications such as ResidentApp and others to store user settings in a standardized format (as a JSON file) suitable for EntOS consumption. The MigrationPreparer Thunder plugin will exist only in the RDKV ecosystem. diff --git a/MigrationPreparer/MigrationPreparer.cpp b/MigrationPreparer/MigrationPreparer.cpp index 1fd16b7797..c3f2d0d4a0 100644 --- a/MigrationPreparer/MigrationPreparer.cpp +++ b/MigrationPreparer/MigrationPreparer.cpp @@ -21,7 +21,7 @@ #define API_VERSION_NUMBER_MAJOR 1 #define API_VERSION_NUMBER_MINOR 0 -#define API_VERSION_NUMBER_PATCH 0 +#define API_VERSION_NUMBER_PATCH 1 namespace WPEFramework { diff --git a/MigrationPreparer/MigrationPreparerImplementation.cpp b/MigrationPreparer/MigrationPreparerImplementation.cpp index 24ad32edfc..c2cfacefb6 100644 --- a/MigrationPreparer/MigrationPreparerImplementation.cpp +++ b/MigrationPreparer/MigrationPreparerImplementation.cpp @@ -157,7 +157,7 @@ namespace Plugin { } int8_t MigrationPreparerImplementation::split(std::list& list, string& value, std::string delimiter) { - LOGINFO("split: %s", value.c_str()); + // LOGINFO("split: %s", value.c_str()); string::size_type start = 0, pos = 0; while ((pos = value.find(delimiter, start) )!= std::string::npos) { list.emplace_back(value.substr(start, pos - start)); @@ -178,7 +178,7 @@ namespace Plugin { } // Add the last element without an underscore value += *it; - LOGINFO("join: %s", value.c_str()); + // LOGINFO("join: %s", value.c_str()); return Core::ERROR_NONE; } @@ -196,7 +196,8 @@ namespace Plugin { uint32_t MigrationPreparerImplementation::write(const string& name, const string &value) { - LOGINFO("[WRITE] params={name: %s, value: %s}", name.c_str(), value.c_str()); + // LOGINFO("[WRITE] params={name: %s, value: %s}", name.c_str(), value.c_str()); + LOGINFO("Writing entry for name: %s", name.c_str()); string entry; string key = name; string newValue = value; @@ -232,7 +233,8 @@ namespace Plugin { if(!dataStore.Open(false)) { LOGERR("Failed to open migration datastore %s, errno: %d, reason: %s", DATASTORE_PATH, errno, strerror(errno)); - LOGERR("Failed to create entry for {%s:%s} in migration datastore", key.c_str(), newValue.c_str()); + // LOGERR("Failed to create entry for {%s:%s} in migration datastore", key.c_str(), newValue.c_str()); + LOGERR("Failed to create entry for name: %s in migration datastore", key.c_str()); _dataStoreMutex.unlock(); return ERROR_OPEN; } @@ -253,7 +255,8 @@ namespace Plugin { string oldValue = _valueEntry[_lineNumber[key] - 2]; if(oldValue == newValue) { - LOGWARN("Entry {%s:%s} is already existing in the dataStore, returning success", oldValue.c_str(), key.c_str()); + // LOGWARN("Entry {%s:%s} is already existing in the dataStore, returning success", oldValue.c_str(), key.c_str()); + LOGWARN("Entry for name: %s is already existing in the dataStore, returning success", key.c_str()); _dataStoreMutex.unlock(); return Core::ERROR_NONE; } @@ -279,7 +282,8 @@ namespace Plugin { return Core::ERROR_NONE; } result = WEXITSTATUS(result); - LOGERR("Failed to update entry for {%s:%s} in migration datastore, v_secure_system failed with error %d",key.c_str(), newValue.c_str(), result); + // LOGERR("Failed to update entry for {%s:%s} in migration datastore, v_secure_system failed with error %d",key.c_str(), newValue.c_str(), result); + LOGERR("Failed to update entry for name: %s in migration datastore, v_secure_system failed with error %d",key.c_str(), result); _dataStoreMutex.unlock(); return ERROR_WRITE; } @@ -287,7 +291,8 @@ namespace Plugin { // Handle subsequent Write request if(!dataStore.Open(false)) { LOGERR("Failed to create migration datastore %s, errno: %d, reason: %s", DATASTORE_PATH, errno, strerror(errno)); - LOGERR("Failed to create entry for {%s:%s} in migration datastore", key.c_str(), newValue.c_str()); + // LOGERR("Failed to create entry for {%s:%s} in migration datastore", key.c_str(), newValue.c_str()); + LOGERR("Failed to create entry for name: %s in migration datastore", key.c_str()); _dataStoreMutex.unlock(); return ERROR_OPEN; } @@ -295,7 +300,8 @@ namespace Plugin { // append new key-value pair to the dataStore if(!dataStore.Position(false, dataStore.Size() - 2)) { LOGERR("DataStore truncate failed with errno: %d, reason: %s\n", errno, strerror(errno)); - LOGERR("Failed to create entry for {%s:%s} in migration datastore", key.c_str(), newValue.c_str()); + // LOGERR("Failed to create entry for {%s:%s} in migration datastore", key.c_str(), newValue.c_str()); + LOGERR("Failed to create entry for %s in migration datastore", key.c_str()); dataStore.Close(); _dataStoreMutex.unlock(); return ERROR_WRITE; @@ -311,7 +317,7 @@ namespace Plugin { uint32_t MigrationPreparerImplementation::read(const string& name, string &result) { - LOGINFO("[READ] params={name: %s}", name.c_str()); + LOGINFO("Reading entry for name: %s", name.c_str()); string key = name; if(!_fileExist) { @@ -336,7 +342,7 @@ namespace Plugin { uint32_t MigrationPreparerImplementation::Delete(const string& name) { - LOGINFO("[DELETE] params={name: %s}", name.c_str()); + LOGINFO("Deleting entry for name: %s", name.c_str()); string key = name; int result; diff --git a/MigrationPreparer/MigrationPreparerJsonRpc.cpp b/MigrationPreparer/MigrationPreparerJsonRpc.cpp index 1ae2ad8845..b9f6f48d8c 100644 --- a/MigrationPreparer/MigrationPreparerJsonRpc.cpp +++ b/MigrationPreparer/MigrationPreparerJsonRpc.cpp @@ -158,8 +158,10 @@ namespace Plugin { response["error"] = error; break; case Core::ERROR_NONE: - status = true; + // In order to avoid printing "value" field in the MigrationPreparer logs, we bypass "returnResponse" macro response["value"] = value; + response["success"] = true; + return WPEFramework::Core::ERROR_NONE; break; default: error["message"] = "Unknown Error";