diff options
| author | Stefan Boberg <[email protected]> | 2021-09-15 11:27:48 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-15 11:27:48 +0200 |
| commit | 2b9bed6635d95e15847c4d9b602e34d90e277d14 (patch) | |
| tree | 66fb191150ccbf9f56315a716abd23b25cc1d401 /zen/cmds/run.cpp | |
| parent | xmake: added zenhttp dependency to make zen CLI tool buld (diff) | |
| download | archived-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/run.cpp')
| -rw-r--r-- | zen/cmds/run.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/cmds/run.cpp b/zen/cmds/run.cpp index 3e6e91a39..e5210f695 100644 --- a/zen/cmds/run.cpp +++ b/zen/cmds/run.cpp @@ -9,10 +9,10 @@ #include <zencore/filesystem.h> #include <zencore/fmtutils.h> #include <zencore/iohash.h> +#include <zencore/logging.h> #include <zencore/string.h> #include <zencore/timer.h> #include <zenserverprocess.h> -#include <zencore/logging.h> #include <filesystem> @@ -89,7 +89,7 @@ RunCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) zen::IoHash Hash = Ios.GetHash(); std::wstring RelativePath = FullPath.lexically_relative(m_RootPath).native(); - // spdlog::info("File: {:32} => {} ({})", zen::WideToUtf8(RelativePath), Hash, FileSize); + // ZEN_INFO("File: {:32} => {} ({})", zen::WideToUtf8(RelativePath), Hash, FileSize); FileEntry& Entry = m_Files[RelativePath]; Entry.Hash = Hash; @@ -164,12 +164,12 @@ RunCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) if (CasResponse.status_code >= 300) { - spdlog::error("CAS put failed with {}", CasResponse.status_code); + ZEN_ERROR("CAS put failed with {}", CasResponse.status_code); } } else { - spdlog::error("unknown hash in 'need' list: {}", NeedHash); + ZEN_ERROR("unknown hash in 'need' list: {}", NeedHash); } } } @@ -177,7 +177,7 @@ RunCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) cpr::Response JobResponse = cpr::Post(cpr::Url("http://localhost:13337/exec/jobs"), cpr::Body((const char*)MemOut.Data(), MemOut.Size())); - spdlog::info("job exec: {}", JobResponse.status_code); + ZEN_INFO("job exec: {}", JobResponse.status_code); return 0; } |