aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/Logging/Log.cpp8
-rw-r--r--src/common/Logging/Log.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/src/common/Logging/Log.cpp b/src/common/Logging/Log.cpp
index 4514fbabd1a..6ec978c3206 100644
--- a/src/common/Logging/Log.cpp
+++ b/src/common/Logging/Log.cpp
@@ -367,13 +367,17 @@ Log* Log::instance() noexcept
void Log::Initialize(Trinity::Asio::IoContext* ioContext)
{
+ SetAsynchronous(ioContext);
+ LoadFromConfig();
+}
+
+void Log::SetAsynchronous(Trinity::Asio::IoContext* ioContext)
+{
if (ioContext)
{
_ioContext = ioContext;
_strand = new Trinity::Asio::Strand(*ioContext);
}
-
- LoadFromConfig();
}
void Log::SetSynchronous()
diff --git a/src/common/Logging/Log.h b/src/common/Logging/Log.h
index 17e0421d422..5621ec67f86 100644
--- a/src/common/Logging/Log.h
+++ b/src/common/Logging/Log.h
@@ -63,6 +63,7 @@ class TC_COMMON_API Log
static Log* instance() noexcept;
void Initialize(Trinity::Asio::IoContext* ioContext);
+ void SetAsynchronous(Trinity::Asio::IoContext* ioContext);
void SetSynchronous(); // Not threadsafe - should only be called from main() after all threads are joined
void LoadFromConfig();
void Close();