aboutsummaryrefslogtreecommitdiff
path: root/zenserver/experimental/usnjournal.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 /zenserver/experimental/usnjournal.cpp
parentxmake: added zenhttp dependency to make zen CLI tool buld (diff)
downloadzen-2b9bed6635d95e15847c4d9b602e34d90e277d14.tar.xz
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 'zenserver/experimental/usnjournal.cpp')
-rw-r--r--zenserver/experimental/usnjournal.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/zenserver/experimental/usnjournal.cpp b/zenserver/experimental/usnjournal.cpp
index b23794b42..ab83b8a1c 100644
--- a/zenserver/experimental/usnjournal.cpp
+++ b/zenserver/experimental/usnjournal.cpp
@@ -3,9 +3,9 @@
#include "usnjournal.h"
#include <zencore/except.h>
+#include <zencore/logging.h>
#include <zencore/timer.h>
#include <zencore/zencore.h>
-#include <zencore/logging.h>
#include <atlfile.h>
@@ -89,7 +89,7 @@ UsnJournalReader::Initialize(std::filesystem::path VolumePath)
ThrowSystemException("Failed to get volume information");
}
- spdlog::debug("File system type is {}", WideToUtf8(FileSystemName));
+ ZEN_DEBUG("File system type is {}", WideToUtf8(FileSystemName));
if (wcscmp(L"ReFS", FileSystemName) == 0)
{
@@ -142,7 +142,7 @@ UsnJournalReader::Initialize(std::filesystem::path VolumePath)
switch (DWORD Error = GetLastError())
{
case ERROR_JOURNAL_NOT_ACTIVE:
- spdlog::info("No USN journal active on drive");
+ ZEN_INFO("No USN journal active on drive");
// TODO: optionally activate USN journal on drive?
@@ -182,7 +182,7 @@ UsnJournalReader::Initialize(std::filesystem::path VolumePath)
if (m_FileSystemType == FileSystemType::NTFS)
{
- spdlog::info("Enumerating MFT for {}", WideToUtf8(VolumePathName));
+ ZEN_INFO("Enumerating MFT for {}", WideToUtf8(VolumePathName));
zen::Stopwatch Timer;
uint64_t MftBytesProcessed = 0;
@@ -261,10 +261,10 @@ UsnJournalReader::Initialize(std::filesystem::path VolumePath)
const auto ElapsedMs = Timer.getElapsedTimeMs();
- spdlog::info("MFT enumeration of {} completed after {} ({})",
- zen::NiceBytes(MftBytesProcessed),
- zen::NiceTimeSpanMs(ElapsedMs),
- zen::NiceByteRate(MftBytesProcessed, ElapsedMs));
+ ZEN_INFO("MFT enumeration of {} completed after {} ({})",
+ zen::NiceBytes(MftBytesProcessed),
+ zen::NiceTimeSpanMs(ElapsedMs),
+ zen::NiceByteRate(MftBytesProcessed, ElapsedMs));
}
// Populate by traversal