From 11d32517c2f6f538209c893c6b0b24572fba1a36 Mon Sep 17 00:00:00 2001 From: Saturneric Date: Fri, 3 Feb 2023 21:43:55 +0800 Subject: feat: change the log style in source files --- src/core/function/FileOperator.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/core/function/FileOperator.cpp') 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; -- cgit v1.2.3