aboutsummaryrefslogtreecommitdiff
path: root/zenstore/filecas.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 /zenstore/filecas.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 'zenstore/filecas.cpp')
-rw-r--r--zenstore/filecas.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/zenstore/filecas.cpp b/zenstore/filecas.cpp
index df42de412..170f13875 100644
--- a/zenstore/filecas.cpp
+++ b/zenstore/filecas.cpp
@@ -5,11 +5,11 @@
#include <zencore/except.h>
#include <zencore/filesystem.h>
#include <zencore/fmtutils.h>
+#include <zencore/logging.h>
#include <zencore/memory.h>
#include <zencore/string.h>
#include <zencore/thread.h>
#include <zencore/uid.h>
-#include <zencore/logging.h>
#include <gsl/gsl-lite.hpp>
@@ -84,7 +84,7 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash)
if (!Success)
{
- spdlog::warn("Failed to flag temporary payload file for deletion: '{}'", PathFromHandle(FileRef.FileHandle));
+ ZEN_WARN("Failed to flag temporary payload file for deletion: '{}'", PathFromHandle(FileRef.FileHandle));
}
};
@@ -173,9 +173,9 @@ FileCasStrategy::InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash)
return CasStore::InsertResult{.New = true};
}
- spdlog::warn("rename of CAS payload file failed ('{}'), falling back to regular write for insert of {}",
- GetLastErrorAsString(),
- ChunkHash);
+ ZEN_WARN("rename of CAS payload file failed ('{}'), falling back to regular write for insert of {}",
+ GetLastErrorAsString(),
+ ChunkHash);
DeletePayloadFileOnClose();
}
@@ -224,7 +224,7 @@ FileCasStrategy::InsertChunk(const void* const ChunkData, const size_t ChunkSize
if ((hRes != HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) && (hRes != HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)))
{
- spdlog::warn("Unexpected error code when opening shard file for read: {:#x}", uint32_t(hRes));
+ ZEN_WARN("Unexpected error code when opening shard file for read: {:#x}", uint32_t(hRes));
}
auto InternalCreateFile = [&] { return PayloadFile.Create(ShardedPath.c_str(), GENERIC_WRITE, FILE_SHARE_DELETE, CREATE_ALWAYS); };