From d1594998f80762fa58f64cf123f9bf9cb77036e4 Mon Sep 17 00:00:00 2001 From: leak Date: Tue, 8 Jul 2014 20:55:25 +0200 Subject: Replaced the LogWorker thread with Boost ASIO --- src/server/shared/Logging/Log.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/server/shared/Logging/Log.h') diff --git a/src/server/shared/Logging/Log.h b/src/server/shared/Logging/Log.h index 8d2fd33d886..e739c9eaf4e 100644 --- a/src/server/shared/Logging/Log.h +++ b/src/server/shared/Logging/Log.h @@ -22,8 +22,9 @@ #include "Define.h" #include "Appender.h" #include "Logger.h" -#include "LogWorker.h" #include +#include +#include #include #include @@ -39,9 +40,17 @@ class Log ~Log(); public: - static Log* instance() + + static Log* instance(boost::asio::io_service* ioService = nullptr) { static Log* instance = new Log(); + + if (ioService != nullptr) + { + instance->_ioService = ioService; + instance->_strand = new boost::asio::strand(*ioService); + } + return instance; } @@ -77,7 +86,8 @@ class Log std::string m_logsDir; std::string m_logsTimestamp; - LogWorker* worker; + boost::asio::io_service* _ioService; + boost::asio::strand* _strand; }; inline Logger const* Log::GetLoggerByType(std::string const& type) const -- cgit v1.2.3