refactor(Core/Logging): switch to fmt style for LOG_ (#10366)

* feat(Core/Common): add support fmt style for ASSERT and ABORT

* correct CheckCompactArrayMaskOverflow

* 1

* Update src/server/game/Spells/Spell.cpp

* rework logging

* add fmt replace logs

* logging

* FMT_LOG_

* settings

* fix startup

* 1

* 2

* 3

* 4

* 5

* fmt::print

* to fmt
This commit is contained in:
Kargatum
2022-01-27 22:44:41 +07:00
committed by GitHub
parent 5228d29379
commit 5969df4e30
211 changed files with 3689 additions and 3842 deletions

View File

@@ -35,18 +35,18 @@ void ACSoapThread(const std::string& host, uint16 port)
if (!soap_valid_socket(soap_bind(&soap, host.c_str(), port, 100)))
{
LOG_ERROR("network.soap", "ACSoap: couldn't bind to %s:%d", host.c_str(), port);
LOG_ERROR("network.soap", "ACSoap: couldn't bind to {}:{}", host, port);
exit(-1);
}
LOG_INFO("network.soap", "ACSoap: bound to http://%s:%d", host.c_str(), port);
LOG_INFO("network.soap", "ACSoap: bound to http://{}:{}", host, port);
while (!World::IsStopped())
{
if (!soap_valid_socket(soap_accept(&soap)))
continue; // ran into an accept timeout
LOG_DEBUG("network.soap", "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.soap", "ACSoap: accepted connection from IP={}.{}.{}.{}", (int)(soap.ip >> 24) & 0xFF, (int)(soap.ip >> 16) & 0xFF, (int)(soap.ip >> 8) & 0xFF, (int)soap.ip & 0xFF);
struct soap* thread_soap = soap_copy(&soap);// make a safe copy
process_message(thread_soap);
@@ -83,26 +83,26 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
uint32 accountId = AccountMgr::GetId(soap->userid);
if (!accountId)
{
LOG_DEBUG("network", "ACSoap: Client used invalid username '%s'", soap->userid);
LOG_DEBUG("network", "ACSoap: Client used invalid username '{}'", soap->userid);
return 401;
}
if (!AccountMgr::CheckPassword(accountId, soap->passwd))
{
LOG_DEBUG("network.soap", "ACSoap: invalid password for account '%s'", soap->userid);
LOG_DEBUG("network.soap", "ACSoap: invalid password for account '{}'", soap->userid);
return 401;
}
if (AccountMgr::GetSecurity(accountId) < SEC_ADMINISTRATOR)
{
LOG_DEBUG("network.soap", "ACSoap: %s's gmlevel is too low", soap->userid);
LOG_DEBUG("network.soap", "ACSoap: {}'s gmlevel is too low", soap->userid);
return 403;
}
if (!command || !*command)
return soap_sender_fault(soap, "Command can not be empty", "The supplied command was an empty string");
LOG_DEBUG("network.soap", "ACSoap: got command '%s'", command);
LOG_DEBUG("network.soap", "ACSoap: got command '{}'", command);
SOAPCommand connection;
// commands are executed in the world thread. We have to wait for them to be completed