Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)

(cherry picked from commit d791afae1d)
This commit is contained in:
Shauren
2023-08-15 20:10:04 +02:00
parent 825c697a76
commit aaa6e73c8c
252 changed files with 4596 additions and 4653 deletions

View File

@@ -118,18 +118,18 @@ int main(int argc, char** argv)
Trinity::Banner::Show("authserver",
[](char const* text)
{
TC_LOG_INFO("server.authserver", "%s", text);
TC_LOG_INFO("server.authserver", "{}", text);
},
[]()
{
TC_LOG_INFO("server.authserver", "Using configuration file %s.", sConfigMgr->GetFilename().c_str());
TC_LOG_INFO("server.authserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION));
TC_LOG_INFO("server.authserver", "Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
TC_LOG_INFO("server.authserver", "Using configuration file {}.", sConfigMgr->GetFilename());
TC_LOG_INFO("server.authserver", "Using SSL version: {} (library: {})", OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION));
TC_LOG_INFO("server.authserver", "Using Boost version: {}.{}.{}", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
}
);
for (std::string const& key : overriddenKeys)
TC_LOG_INFO("server.authserver", "Configuration field '%s' was overridden with environment variable.", key.c_str());
TC_LOG_INFO("server.authserver", "Configuration field '{}' was overridden with environment variable.", key);
OpenSSLCrypto::threadsSetup(boost::dll::program_location().remove_filename());
@@ -140,10 +140,10 @@ int main(int argc, char** argv)
if (!pidFile.empty())
{
if (uint32 pid = CreatePIDFile(pidFile))
TC_LOG_INFO("server.authserver", "Daemon PID: %u\n", pid);
TC_LOG_INFO("server.authserver", "Daemon PID: {}\n", pid);
else
{
TC_LOG_ERROR("server.authserver", "Cannot create PID file %s.\n", pidFile.c_str());
TC_LOG_ERROR("server.authserver", "Cannot create PID file {}.\n", pidFile);
return 1;
}
}