aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/model
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-05 12:55:15 +0000
committersaturneric <[email protected]>2024-01-05 12:55:15 +0000
commit644aa4397b03dbef73f8bfedc13925b51cad836b (patch)
tree7788d1cd2f0687dd8e576b111d9990c580092e7a /src/core/model
parentfix: slove some known issues (diff)
downloadGpgFrontend-644aa4397b03dbef73f8bfedc13925b51cad836b.tar.gz
GpgFrontend-644aa4397b03dbef73f8bfedc13925b51cad836b.zip
feat: integrate logging api to core
Diffstat (limited to 'src/core/model')
-rw-r--r--src/core/model/DataObject.h2
-rw-r--r--src/core/model/GFDataExchanger.cpp4
-rw-r--r--src/core/model/GpgDecryptResult.cpp2
-rw-r--r--src/core/model/GpgEncryptResult.cpp2
-rw-r--r--src/core/model/GpgGenKeyInfo.cpp4
-rw-r--r--src/core/model/GpgSignResult.cpp2
6 files changed, 10 insertions, 6 deletions
diff --git a/src/core/model/DataObject.h b/src/core/model/DataObject.h
index 56c86bf6..6b41a051 100644
--- a/src/core/model/DataObject.h
+++ b/src/core/model/DataObject.h
@@ -70,7 +70,7 @@ class GPGFRONTEND_CORE_EXPORT DataObject {
for (size_t i = 0; i < type_list.size(); ++i) {
if (std::type_index(*type_list[i]) !=
std::type_index((*this)[i].type())) {
- SPDLOG_ERROR(
+ GF_CORE_LOG_ERROR(
"value of index {} in data object is type: {}, "
"not expected type: {}",
i, ((*this)[i]).type().name(), type_list[i]->name());
diff --git a/src/core/model/GFDataExchanger.cpp b/src/core/model/GFDataExchanger.cpp
index c2aca929..70a6498e 100644
--- a/src/core/model/GFDataExchanger.cpp
+++ b/src/core/model/GFDataExchanger.cpp
@@ -28,6 +28,8 @@
#include "GFDataExchanger.h"
+#include "core/utils/LogUtils.h"
+
namespace GpgFrontend {
auto GFDataExchanger::Write(const std::byte* buffer, size_t size) -> ssize_t {
@@ -47,7 +49,7 @@ auto GFDataExchanger::Write(const std::byte* buffer, size_t size) -> ssize_t {
write_bytes++;
}
} catch (...) {
- SPDLOG_ERROR(
+ GF_CORE_LOG_ERROR(
"gf data exchanger caught exception when it writes to queue, abort...");
}
diff --git a/src/core/model/GpgDecryptResult.cpp b/src/core/model/GpgDecryptResult.cpp
index a0719c0c..3568bfd9 100644
--- a/src/core/model/GpgDecryptResult.cpp
+++ b/src/core/model/GpgDecryptResult.cpp
@@ -55,7 +55,7 @@ auto GpgDecryptResult::Recipients() -> std::vector<GpgRecipient> {
try {
result.emplace_back(reci);
} catch (...) {
- SPDLOG_ERROR(
+ GF_CORE_LOG_ERROR(
"caught exception when processing invalid_recipients, "
"maybe nullptr of fpr");
}
diff --git a/src/core/model/GpgEncryptResult.cpp b/src/core/model/GpgEncryptResult.cpp
index 6f39ed68..f135dac9 100644
--- a/src/core/model/GpgEncryptResult.cpp
+++ b/src/core/model/GpgEncryptResult.cpp
@@ -55,7 +55,7 @@ auto GpgEncryptResult::InvalidRecipients()
try {
result.emplace_back(std::string{invalid_key->fpr}, invalid_key->reason);
} catch (...) {
- SPDLOG_ERROR(
+ GF_CORE_LOG_ERROR(
"caught exception when processing invalid_recipients, "
"maybe nullptr of fpr");
}
diff --git a/src/core/model/GpgGenKeyInfo.cpp b/src/core/model/GpgGenKeyInfo.cpp
index 1933a1db..15eb9b10 100644
--- a/src/core/model/GpgGenKeyInfo.cpp
+++ b/src/core/model/GpgGenKeyInfo.cpp
@@ -32,10 +32,12 @@
#include <boost/format.hpp>
#include <cassert>
+#include "core/utils/LogUtils.h"
+
namespace GpgFrontend {
void GenKeyInfo::SetAlgo(const GenKeyInfo::KeyGenAlgo &m_algo) {
- SPDLOG_DEBUG("set algo name: {}", m_algo.first);
+ GF_CORE_LOG_DEBUG("set algo name: {}", m_algo.first);
// Check algo if supported
std::string algo_args = m_algo.second;
if (standalone_) {
diff --git a/src/core/model/GpgSignResult.cpp b/src/core/model/GpgSignResult.cpp
index aa35e57a..90d337b7 100644
--- a/src/core/model/GpgSignResult.cpp
+++ b/src/core/model/GpgSignResult.cpp
@@ -55,7 +55,7 @@ auto GpgSignResult::InvalidSigners()
try {
result.emplace_back(std::string{invalid_key->fpr}, invalid_key->reason);
} catch (...) {
- SPDLOG_ERROR(
+ GF_CORE_LOG_ERROR(
"caught exception when processing invalid_signers, "
"maybe nullptr of fpr");
}