feat(Core/Logging): rework logging (#4692)

* feat(Core/Logging): rework logging

* correct level for sql.sql

* del unused config options

* Correct build

* correct after merge

* whitespace

20:29:37 1. 'Player.cpp'. Replace (1)
20:29:37 2. 'ObjectMgr.cpp'. Replace (3)

* 1

* correct logging

* correct affter merge

* 1

* 2

* LOG_LEVEL_WARN

* #include "AppenderDB.h"

* 3

* 4

* 5

* 1. 'WorldSocket.cpp'. Replace (1)

* 6

* 1
This commit is contained in:
Kargatum
2021-04-17 16:20:07 +07:00
committed by GitHub
parent b2861be1cd
commit 4af4cbd3d9
246 changed files with 7413 additions and 6807 deletions

View File

@@ -23,11 +23,11 @@ void ACSoapRunnable::run()
soap.send_timeout = 5;
if (!soap_valid_socket(soap_bind(&soap, _host.c_str(), _port, 100)))
{
sLog->outError("ACSoap: couldn't bind to %s:%d", _host.c_str(), _port);
LOG_ERROR("server", "ACSoap: couldn't bind to %s:%d", _host.c_str(), _port);
exit(-1);
}
sLog->outString("ACSoap: bound to http://%s:%d", _host.c_str(), _port);
LOG_INFO("server", "ACSoap: bound to http://%s:%d", _host.c_str(), _port);
while (!World::IsStopped())
{
@@ -35,7 +35,7 @@ void ACSoapRunnable::run()
continue; // ran into an accept timeout
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "ACSoap: accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip >> 24) & 0xFF, (int)(soap.ip >> 16) & 0xFF, (int)(soap.ip >> 8) & 0xFF, (int)soap.ip & 0xFF);
LOG_DEBUG("network", "ACSoap: accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip >> 24) & 0xFF, (int)(soap.ip >> 16) & 0xFF, (int)(soap.ip >> 8) & 0xFF, (int)soap.ip & 0xFF);
#endif
struct soap* thread_soap = soap_copy(&soap);// make a safe copy
@@ -72,7 +72,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
if (!soap->userid || !soap->passwd)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "ACSoap: Client didn't provide login information");
LOG_DEBUG("network", "ACSoap: Client didn't provide login information");
#endif
return 401;
}
@@ -81,7 +81,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
if (!accountId)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "ACSoap: Client used invalid username '%s'", soap->userid);
LOG_DEBUG("network", "ACSoap: Client used invalid username '%s'", soap->userid);
#endif
return 401;
}
@@ -89,7 +89,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
if (!AccountMgr::CheckPassword(accountId, soap->passwd))
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "ACSoap: invalid password for account '%s'", soap->userid);
LOG_DEBUG("network", "ACSoap: invalid password for account '%s'", soap->userid);
#endif
return 401;
}
@@ -97,7 +97,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
if (AccountMgr::GetSecurity(accountId) < SEC_ADMINISTRATOR)
{
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "ACSoap: %s's gmlevel is too low", soap->userid);
LOG_DEBUG("network", "ACSoap: %s's gmlevel is too low", soap->userid);
#endif
return 403;
}
@@ -106,7 +106,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
return soap_sender_fault(soap, "Command can not be empty", "The supplied command was an empty string");
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "ACSoap: got command '%s'", command);
LOG_DEBUG("network", "ACSoap: got command '%s'", command);
#endif
SOAPCommand connection;
@@ -122,7 +122,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
int acc = connection.pendingCommands.acquire();
if (acc)
{
sLog->outError("ACSoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno);
LOG_ERROR("server", "ACSoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno);
}
// alright, command finished