aboutsummaryrefslogtreecommitdiff
path: root/zenserver/upstream
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-10-05 18:10:19 +0200
committerStefan Boberg <[email protected]>2021-10-05 18:10:19 +0200
commit09fa320db4c7727c04eb88f5d19c4c1a3b2189e8 (patch)
tree0d0649b08d8ee479287e8ef4cc6f2507a74f9ed5 /zenserver/upstream
parenthttp: Exclude iothreadpool from compilation on non-Windows (diff)
parentPass logger from Zen client to session instead from spdlog registry. (diff)
downloadzen-09fa320db4c7727c04eb88f5d19c4c1a3b2189e8.tar.xz
zen-09fa320db4c7727c04eb88f5d19c4c1a3b2189e8.zip
Merge branch 'main' of https://github.com/EpicGames/zen into main
Diffstat (limited to 'zenserver/upstream')
-rw-r--r--zenserver/upstream/zen.cpp6
-rw-r--r--zenserver/upstream/zen.h5
2 files changed, 8 insertions, 3 deletions
diff --git a/zenserver/upstream/zen.cpp b/zenserver/upstream/zen.cpp
index c988a6b0b..6141fd397 100644
--- a/zenserver/upstream/zen.cpp
+++ b/zenserver/upstream/zen.cpp
@@ -328,7 +328,9 @@ namespace detail {
//////////////////////////////////////////////////////////////////////////
-ZenStructuredCacheClient::ZenStructuredCacheClient(std::string_view ServiceUrl) : m_ServiceUrl(ServiceUrl)
+ZenStructuredCacheClient::ZenStructuredCacheClient(std::string_view ServiceUrl)
+: m_Log(logging::Get(std::string_view("zenclient")))
+, m_ServiceUrl(ServiceUrl)
{
}
@@ -369,7 +371,7 @@ ZenStructuredCacheClient::FreeSessionState(detail::ZenCacheSessionState* State)
using namespace std::literals;
ZenStructuredCacheSession::ZenStructuredCacheSession(ZenStructuredCacheClient& OuterClient)
-: m_Log(logging::Get("zenclient"sv))
+: m_Log(OuterClient.Log())
, m_Client(OuterClient)
{
m_SessionState = m_Client.AllocSessionState();
diff --git a/zenserver/upstream/zen.h b/zenserver/upstream/zen.h
index 158be668a..12e46bd8d 100644
--- a/zenserver/upstream/zen.h
+++ b/zenserver/upstream/zen.h
@@ -138,8 +138,11 @@ public:
std::string_view ServiceUrl() const { return m_ServiceUrl; }
+ inline spdlog::logger& Log() { return m_Log; }
+
private:
- std::string m_ServiceUrl;
+ spdlog::logger& m_Log;
+ std::string m_ServiceUrl;
RwLock m_SessionStateLock;
std::list<detail::ZenCacheSessionState*> m_SessionStateCache;