aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/DataObjectOperator.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-07-30 18:42:12 +0000
committersaturneric <[email protected]>2024-07-30 18:42:12 +0000
commitdbb4a21931cd10a3caed3c446af0fe06de9873b1 (patch)
treeb3eb2e6fc3e67ea274472dfacfa3451848b43c80 /src/core/function/DataObjectOperator.cpp
parentfix: solve known issues on build (diff)
downloadGpgFrontend-dbb4a21931cd10a3caed3c446af0fe06de9873b1.tar.gz
GpgFrontend-dbb4a21931cd10a3caed3c446af0fe06de9873b1.zip
feat: simplify logging
Diffstat (limited to 'src/core/function/DataObjectOperator.cpp')
-rw-r--r--src/core/function/DataObjectOperator.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/core/function/DataObjectOperator.cpp b/src/core/function/DataObjectOperator.cpp
index 634228c9..b762b1c8 100644
--- a/src/core/function/DataObjectOperator.cpp
+++ b/src/core/function/DataObjectOperator.cpp
@@ -49,8 +49,7 @@ DataObjectOperator::DataObjectOperator(int channel)
QByteArray key;
if (!ReadFile(app_secure_key_path_, key)) {
- qCWarning(core) << "failed to read app secure key file: "
- << app_secure_key_path_;
+ LOG_W() << "failed to read app secure key file: " << app_secure_key_path_;
// unsafe mode
key = {};
}
@@ -91,7 +90,7 @@ auto DataObjectOperator::SaveDataObj(const QString& key,
}
if (!WriteFile(target_obj_path, encoded_data)) {
- qCWarning(core) << "failed to write data object to disk: " << key;
+ LOG_W() << "failed to write data object to disk: " << key;
}
return key.isEmpty() ? hash_obj_key : QString();
}
@@ -105,13 +104,13 @@ auto DataObjectOperator::GetDataObject(const QString& key)
const auto obj_path = app_data_objs_path_ + "/" + hash_obj_key;
if (!QFileInfo(obj_path).exists()) {
- qCWarning(core) << "data object not found from disk, key: " << key;
+ LOG_W() << "data object not found from disk, key: " << key;
return {};
}
QByteArray encoded_data;
if (!ReadFile(obj_path, encoded_data)) {
- qCWarning(core) << "failed to read data object from disk, key: " << key;
+ LOG_W() << "failed to read data object from disk, key: " << key;
return {};
}
@@ -123,8 +122,7 @@ auto DataObjectOperator::GetDataObject(const QString& key)
return QJsonDocument::fromJson(decoded_data);
} catch (...) {
- qCWarning(core) << "failed to get data object:" << key
- << " caught exception.";
+ LOG_W() << "failed to get data object:" << key << " caught exception.";
return {};
}
}