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 /zenserver/testing/launch.cpp | |
| parent | xmake: added zenhttp dependency to make zen CLI tool buld (diff) | |
| download | zen-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/testing/launch.cpp')
| -rw-r--r-- | zenserver/testing/launch.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp index f7db9dd71..608b515e1 100644 --- a/zenserver/testing/launch.cpp +++ b/zenserver/testing/launch.cpp @@ -80,7 +80,7 @@ BasicJob::SpawnJob(std::filesystem::path ExePath, std::wstring CommandLine) m_ProcessHandle.Attach(ProcessInfo.hProcess); ::CloseHandle(ProcessInfo.hThread); - spdlog::info("Created process {}", m_ProcessId); + ZEN_INFO("Created process {}", m_ProcessId); return true; } @@ -116,12 +116,12 @@ BasicJob::ExitCode() if (!Success) { - spdlog::warn("failed getting exit code"); + ZEN_WARN("failed getting exit code"); } if (Ec == STILL_ACTIVE) { - spdlog::warn("getting exit code but process is STILL_ACTIVE"); + ZEN_WARN("getting exit code but process is STILL_ACTIVE"); } return gsl::narrow_cast<int>(Ec); @@ -222,7 +222,7 @@ SandboxedJob::Initialize(std::string_view AppContainerId) if (FAILED(hRes)) { - spdlog::error("Failed creating app container SID"); + ZEN_ERROR("Failed creating app container SID"); } } @@ -231,12 +231,12 @@ SandboxedJob::Initialize(std::string_view AppContainerId) PWSTR Str = nullptr; ::ConvertSidToStringSid(m_AppContainerSid, &Str); - spdlog::info("AppContainer SID : '{}'", WideToUtf8(Str)); + ZEN_INFO("AppContainer SID : '{}'", WideToUtf8(Str)); PWSTR Path = nullptr; if (SUCCEEDED(::GetAppContainerFolderPath(Str, &Path))) { - spdlog::info("AppContainer folder: '{}'", WideToUtf8(Path)); + ZEN_INFO("AppContainer folder: '{}'", WideToUtf8(Path)); ::CoTaskMemFree(Path); } @@ -312,7 +312,7 @@ SandboxedJob::SpawnJob(std::filesystem::path ExePath) return false; } - spdlog::info("Created process {}", ProcessInfo.dwProcessId); + ZEN_INFO("Created process {}", ProcessInfo.dwProcessId); return true; } @@ -393,7 +393,7 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat if (!m_CasStore.FindChunk(FileHash)) { - spdlog::debug("NEED: {} {} {}", FileHash, Ob["file"sv].AsString(), Ob["size"sv].AsUInt64()); + ZEN_DEBUG("NEED: {} {} {}", FileHash, Ob["file"sv].AsString(), Ob["size"sv].AsUInt64()); NeedList.push_back(FileHash); } @@ -438,7 +438,7 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat std::filesystem::path SandboxDir{CreateNewSandbox()}; - spdlog::debug("setting up job in sandbox '{}'", SandboxDir); + ZEN_DEBUG("setting up job in sandbox '{}'", SandboxDir); zen::DeleteDirectories(SandboxDir); zen::CreateDirectories(SandboxDir); @@ -453,7 +453,7 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat if (IoBuffer Chunk = m_CasStore.FindChunk(FileHash); !Chunk) { - spdlog::debug("MISSING: {} {} {}", FileHash, FileName, FileSize); + ZEN_DEBUG("MISSING: {} {} {}", FileHash, FileName, FileSize); AllOk = false; NeedList.push_back(FileHash); @@ -480,7 +480,7 @@ HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::pat std::wstring Executable = Utf8ToWide(Executable8); std::wstring Args = Utf8ToWide(Args8); - spdlog::debug("spawning job in sandbox '{}': '{}' '{}'", SandboxDir, Executable8, Args8); + ZEN_DEBUG("spawning job in sandbox '{}': '{}' '{}'", SandboxDir, Executable8, Args8); std::filesystem::path ExeName = SandboxDir / Executable; @@ -516,7 +516,7 @@ HttpLaunchService::HandleRequest(HttpServerRequest& Request) { if (m_Router.HandleRequest(Request) == false) { - m_Log.warn("No route found for {0}", Request.RelativeUri()); + ZEN_WARN("No route found for {0}", Request.RelativeUri()); } } |