aboutsummaryrefslogtreecommitdiff
path: root/src/common/Logging
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-10-27 00:52:51 +0200
committerShauren <shauren.trinity@gmail.com>2025-10-26 23:37:15 +0100
commit62ba3d8b4ee2e2acd0d574600137dbdd65b92f50 (patch)
treebf329087812f32eeea1b07b78bf27c4a697badbf /src/common/Logging
parente8252152cfff5fad65fa0ba8f857d85dc9c7dbf6 (diff)
Tools/mmaps_generator: Enable async console logging
Diffstat (limited to 'src/common/Logging')
-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();