Core/Logging: Refactored appender creation to allow using logging without mysql dependency in tools (future task)

Conflicts:
	src/server/bnetserver/Main.cpp
	src/server/worldserver/Main.cpp
This commit is contained in:
Shauren
2015-08-16 00:12:18 +02:00
committed by DDuarte
parent c1e3fdc826
commit cdbd563157
12 changed files with 123 additions and 97 deletions

View File

@@ -48,6 +48,7 @@
#include "WorldSocket.h"
#include "WorldSocketMgr.h"
#include "DatabaseLoader.h"
#include "AppenderDB.h"
using namespace boost::program_options;
@@ -120,11 +121,9 @@ extern int main(int argc, char** argv)
return 1;
}
if (sConfigMgr->GetBoolDefault("Log.Async.Enable", false))
{
// If logs are supposed to be handled async then we need to pass the io_service into the Log singleton
Log::instance(&_ioService);
}
sLog->RegisterAppender<AppenderDB>();
// If logs are supposed to be handled async then we need to pass the io_service into the Log singleton
sLog->Initialize(sConfigMgr->GetBoolDefault("Log.Async.Enable", false) ? &_ioService : nullptr);
TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon)", _FULLVERSION);
TC_LOG_INFO("server.worldserver", "<Ctrl-C> to stop.\n");