aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/FileOperator.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2023-02-03 13:43:55 +0000
committerSaturneric <[email protected]>2023-02-03 13:43:55 +0000
commit11d32517c2f6f538209c893c6b0b24572fba1a36 (patch)
tree0dac14bcad75d9c7c5b5723dc23e6409721966b4 /src/core/function/FileOperator.cpp
parentfeat: change logging framework to spdlog (diff)
downloadGpgFrontend-11d32517c2f6f538209c893c6b0b24572fba1a36.tar.gz
GpgFrontend-11d32517c2f6f538209c893c6b0b24572fba1a36.zip
feat: change the log style in source files
Diffstat (limited to 'src/core/function/FileOperator.cpp')
-rw-r--r--src/core/function/FileOperator.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/function/FileOperator.cpp b/src/core/function/FileOperator.cpp
index fcbdb91c..63599bd1 100644
--- a/src/core/function/FileOperator.cpp
+++ b/src/core/function/FileOperator.cpp
@@ -32,7 +32,7 @@ bool GpgFrontend::FileOperator::ReadFile(const QString& file_name,
QByteArray& data) {
QFile file(file_name);
if (!file.open(QIODevice::ReadOnly)) {
- LOG(ERROR) << "failed to open file" << file_name.toStdString();
+ SPDLOG_ERROR("failed to open file: {}", file_name.toStdString());
return false;
}
data = file.readAll();
@@ -44,7 +44,7 @@ bool GpgFrontend::FileOperator::WriteFile(const QString& file_name,
const QByteArray& data) {
QFile file(file_name);
if (!file.open(QIODevice::WriteOnly)) {
- LOG(ERROR) << "failed to open file" << file_name.toStdString();
+ SPDLOG_ERROR("failed to open file: {}", file_name.toStdString());
return false;
}
file.write(data);
@@ -94,7 +94,7 @@ std::string GpgFrontend::FileOperator::CalculateHash(
// md5
hash_md5.addData(buffer);
auto md5 = hash_md5.result().toHex().toStdString();
- LOG(INFO) << "md5" << md5;
+ SPDLOG_INFO("md5 {}", md5);
ss << " "
<< "md5" << _(": ") << md5 << std::endl;
@@ -102,7 +102,7 @@ std::string GpgFrontend::FileOperator::CalculateHash(
// sha1
hash_sha1.addData(buffer);
auto sha1 = hash_sha1.result().toHex().toStdString();
- LOG(INFO) << "sha1" << sha1;
+ SPDLOG_INFO("sha1 {}", sha1);
ss << " "
<< "sha1" << _(": ") << sha1 << std::endl;
@@ -110,7 +110,7 @@ std::string GpgFrontend::FileOperator::CalculateHash(
// sha1
hash_sha256.addData(buffer);
auto sha256 = hash_sha256.result().toHex().toStdString();
- LOG(INFO) << "sha256" << sha256;
+ SPDLOG_INFO("sha256 {}", sha256);
ss << " "
<< "sha256" << _(": ") << sha256 << std::endl;