aboutsummaryrefslogtreecommitdiff
path: root/zenserver/testing/launch.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-09-15 13:18:34 +0200
committerStefan Boberg <[email protected]>2021-09-15 13:18:34 +0200
commitab95978c10258cab130ef7e6dc3f7cb7a1bf337d (patch)
treea6e4ca55890f5b728f69ccf8878af98ba2e31bc9 /zenserver/testing/launch.cpp
parentAdded #ifdef condition around Windows-specific exception handling (diff)
parentCross-platform zen::GetLastError() (diff)
downloadzen-ab95978c10258cab130ef7e6dc3f7cb7a1bf337d.tar.xz
zen-ab95978c10258cab130ef7e6dc3f7cb7a1bf337d.zip
Merged from main
Diffstat (limited to 'zenserver/testing/launch.cpp')
-rw-r--r--zenserver/testing/launch.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/zenserver/testing/launch.cpp b/zenserver/testing/launch.cpp
index b031193d5..608b515e1 100644
--- a/zenserver/testing/launch.cpp
+++ b/zenserver/testing/launch.cpp
@@ -8,6 +8,7 @@
#include <zencore/fmtutils.h>
#include <zencore/iobuffer.h>
#include <zencore/iohash.h>
+#include <zencore/logging.h>
#include <zencore/windows.h>
#include <zenstore/CAS.h>
@@ -79,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;
}
@@ -115,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);
@@ -221,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");
}
}
@@ -230,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);
}
@@ -311,13 +312,13 @@ SandboxedJob::SpawnJob(std::filesystem::path ExePath)
return false;
}
- spdlog::info("Created process {}", ProcessInfo.dwProcessId);
+ ZEN_INFO("Created process {}", ProcessInfo.dwProcessId);
return true;
}
HttpLaunchService::HttpLaunchService(CasStore& Store, const std::filesystem::path& SandboxBaseDir)
-: m_Log("exec", begin(spdlog::default_logger()->sinks()), end(spdlog::default_logger()->sinks()))
+: m_Log(logging::Get("exec"))
, m_CasStore(Store)
, m_SandboxPath(SandboxBaseDir)
{
@@ -392,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);
}
@@ -437,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);
@@ -452,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);
@@ -479,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;
@@ -515,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());
}
}