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

@@ -316,14 +316,20 @@ bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, c
zoneName = zone->area_name[locale];
}
sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (%ul) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected: %s (%ul)]",
fullcmd.c_str(), player->GetName().c_str(), GUID_LOPART(player->GetGUID()),
m_session->GetAccountId(), player->GetPositionX(), player->GetPositionY(),
player->GetPositionZ(), player->GetMapId(),
player->GetMap()->GetMapName(),
areaId, areaName.c_str(), zoneName.c_str(),
(player->GetSelectedUnit()) ? player->GetSelectedUnit()->GetName().c_str() : "",
GUID_LOPART(guid));
LOG_GM(m_session->GetAccountId(), "Command: %s [Player: %s (%u) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected: %s (%ul)]",
fullcmd.c_str(),
player->GetName().c_str(),
GUID_LOPART(player->GetGUID()),
m_session->GetAccountId(),
player->GetPositionX(),
player->GetPositionY(),
player->GetPositionZ(),
player->GetMapId(),
player->GetMap()->GetMapName(),
areaId, areaName.c_str(),
zoneName.c_str(),
(player->GetSelectedUnit()) ? player->GetSelectedUnit()->GetName().c_str() : "",
GUID_LOPART(guid));
}
}
// some commands have custom error messages. Don't send the default one in these cases.
@@ -372,12 +378,12 @@ bool ChatHandler::SetDataForCommandInTable(std::vector<ChatCommand>& table, char
// expected subcommand by full name DB content
else if (*text)
{
sLog->outError("Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str());
LOG_ERROR("server", "Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str());
return false;
}
//if (table[i].SecurityLevel != security)
// sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security);
// LOG_DEBUG("server", "Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security);
table[i].SecurityLevel = security;
table[i].Help = help;
@@ -388,9 +394,9 @@ bool ChatHandler::SetDataForCommandInTable(std::vector<ChatCommand>& table, char
if (!cmd.empty())
{
if (&table == &getCommandTable())
sLog->outError("Table `command` have non-existing command '%s', skip.", cmd.c_str());
LOG_ERROR("server", "Table `command` have non-existing command '%s', skip.", cmd.c_str());
else
sLog->outError("Table `command` have non-existing subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
LOG_ERROR("server", "Table `command` have non-existing subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
}
return false;