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

@@ -61,7 +61,7 @@ void BanExpiryHandler(std::weak_ptr<Acore::Asio::DeadlineTimer> banExpiryCheckTi
/// Print out the usage string for this program on the console.
void usage(const char* prog)
{
LOG_INFO("server.authserver", "Usage: \n %s [<options>]\n"
LOG_INFO("server.authserver", "Usage: \n {} [<options>]\n"
" -c config_file use config_file as configuration file\n\r", prog);
}
@@ -103,13 +103,13 @@ int main(int argc, char** argv)
Acore::Banner::Show("authserver",
[](std::string_view text)
{
FMT_LOG_INFO("server.authserver", text);
LOG_INFO("server.authserver", text);
},
[]()
{
FMT_LOG_INFO("server.authserver", "> Using configuration file {}", sConfigMgr->GetFilename());
FMT_LOG_INFO("server.authserver", "> Using SSL version: {} (library: {})", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
FMT_LOG_INFO("server.authserver", "> Using Boost version: {}.{}.{}", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
LOG_INFO("server.authserver", "> Using configuration file {}", sConfigMgr->GetFilename());
LOG_INFO("server.authserver", "> Using SSL version: {} (library: {})", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
LOG_INFO("server.authserver", "> Using Boost version: {}.{}.{}", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
});
// authserver PID file creation
@@ -117,10 +117,10 @@ int main(int argc, char** argv)
if (!pidFile.empty())
{
if (uint32 pid = CreatePIDFile(pidFile))
LOG_INFO("server.authserver", "Daemon PID: %u\n", pid); // outError for red color in console
LOG_INFO("server.authserver", "Daemon PID: {}\n", pid); // outError for red color in console
else
{
LOG_ERROR("server.authserver", "Cannot create PID file %s (possible error: permission)\n", pidFile.c_str());
LOG_ERROR("server.authserver", "Cannot create PID file {} (possible error: permission)\n", pidFile);
return 1;
}
}