aboutsummaryrefslogtreecommitdiff
path: root/zen/cmds/hash.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-15 11:27:48 +0200
committerStefan Boberg <[email protected]>2021-09-15 11:27:48 +0200
commit2b9bed6635d95e15847c4d9b602e34d90e277d14 (patch)
tree66fb191150ccbf9f56315a716abd23b25cc1d401 /zen/cmds/hash.cpp
parentxmake: added zenhttp dependency to make zen CLI tool buld (diff)
downloadarchived-zen-2b9bed6635d95e15847c4d9b602e34d90e277d14.tar.xz
archived-zen-2b9bed6635d95e15847c4d9b602e34d90e277d14.zip
Changed logging implementation
* Code should no longer directly `#include spdlog/spdlog.h`, instead use `#include <zencore/logging.h>` * Instead of explicit calls to `spdlog::info(...)` and such please use the logging macros defined in `zencore/logging.h`. I.e `ZEN_INFO`, `ZEN_DEBUG`, `ZEN_TRACE`, `ZEN_ERROR`, `ZEN_CRITITCAL` * The macros will pick up the "most local" logger via a `Log()` call to retrieve a logger instance. To override the default logger in a class please implement your own `Log()` function
Diffstat (limited to 'zen/cmds/hash.cpp')
-rw-r--r--zen/cmds/hash.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/cmds/hash.cpp b/zen/cmds/hash.cpp
index 420496cbd..b6276dbc1 100644
--- a/zen/cmds/hash.cpp
+++ b/zen/cmds/hash.cpp
@@ -3,9 +3,9 @@
#include "hash.h"
#include <zencore/blake3.h>
+#include <zencore/logging.h>
#include <zencore/string.h>
#include <zencore/timer.h>
-#include <zencore/logging.h>
#include <ppl.h>
@@ -33,7 +33,7 @@ HashCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
// Gather list of files to process
- spdlog::info("Gathering files from {}", m_ScanDirectory);
+ ZEN_INFO("Gathering files from {}", m_ScanDirectory);
struct FileEntry
{
@@ -55,7 +55,7 @@ HashCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
}
}
- spdlog::info("Gathered {} files, total size {}", FileList.size(), zen::NiceBytes(FileBytes));
+ ZEN_INFO("Gathered {} files, total size {}", FileList.size(), zen::NiceBytes(FileBytes));
Concurrency::combinable<uint64_t> TotalBytes;
@@ -88,8 +88,8 @@ HashCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv)
TotalBytes.combine_each([&](size_t Total) { TotalByteCount += Total; });
const uint64_t ElapsedMs = Timer.getElapsedTimeMs();
- spdlog::info("Scanned {} files in {}", FileList.size(), zen::NiceTimeSpanMs(ElapsedMs));
- spdlog::info("Total bytes {} ({})", zen::NiceBytes(TotalByteCount), zen::NiceByteRate(TotalByteCount, ElapsedMs));
+ ZEN_INFO("Scanned {} files in {}", FileList.size(), zen::NiceTimeSpanMs(ElapsedMs));
+ ZEN_INFO("Total bytes {} ({})", zen::NiceBytes(TotalByteCount), zen::NiceByteRate(TotalByteCount, ElapsedMs));
InternalFile Output;