From aaa6e73c8ca6d60e943cb964605536eb78219db2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 15 Aug 2023 20:10:04 +0200 Subject: Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api) (cherry picked from commit d791afae1dfcfaf592326f787755ca32d629e4d3) --- src/server/database/Database/DatabaseLoader.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/server/database/Database/DatabaseLoader.cpp') diff --git a/src/server/database/Database/DatabaseLoader.cpp b/src/server/database/Database/DatabaseLoader.cpp index 7a0e8c05c01..bc66fb32591 100644 --- a/src/server/database/Database/DatabaseLoader.cpp +++ b/src/server/database/Database/DatabaseLoader.cpp @@ -39,15 +39,15 @@ DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool& pool, std::st std::string const dbString = sConfigMgr->GetStringDefault(name + "DatabaseInfo", ""); if (dbString.empty()) { - TC_LOG_ERROR(_logger, "Database %s not specified in configuration file!", name.c_str()); + TC_LOG_ERROR(_logger, "Database {} not specified in configuration file!", name); return false; } uint8 const asyncThreads = uint8(sConfigMgr->GetIntDefault(name + "Database.WorkerThreads", 1)); if (asyncThreads < 1 || asyncThreads > 32) { - TC_LOG_ERROR(_logger, "%s database: invalid number of worker threads specified. " - "Please pick a value between 1 and 32.", name.c_str()); + TC_LOG_ERROR(_logger, "{} database: invalid number of worker threads specified. " + "Please pick a value between 1 and 32.", name); return false; } @@ -67,8 +67,8 @@ DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool& pool, std::st // If the error wasn't handled quit if (error) { - TC_LOG_ERROR("sql.driver", "\nDatabasePool %s NOT opened. There were errors opening the MySQL connections. Check your SQLDriverLogFile " - "for specific errors. Read wiki at http://www.trinitycore.info/display/tc/TrinityCore+Home", name.c_str()); + TC_LOG_ERROR("sql.driver", "\nDatabasePool {} NOT opened. There were errors opening the MySQL connections. Check your SQLDriverLogFile " + "for specific errors. Read wiki at http://www.trinitycore.info/display/tc/TrinityCore+Home", name); return false; } @@ -88,7 +88,7 @@ DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool& pool, std::st { if (!DBUpdater::Populate(pool)) { - TC_LOG_ERROR(_logger, "Could not populate the %s database, see log for details.", name.c_str()); + TC_LOG_ERROR(_logger, "Could not populate the {} database, see log for details.", name); return false; } return true; @@ -98,7 +98,7 @@ DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool& pool, std::st { if (!DBUpdater::Update(pool)) { - TC_LOG_ERROR(_logger, "Could not update the %s database, see log for details.", name.c_str()); + TC_LOG_ERROR(_logger, "Could not update the {} database, see log for details.", name); return false; } return true; @@ -109,7 +109,7 @@ DatabaseLoader& DatabaseLoader::AddDatabase(DatabaseWorkerPool& pool, std::st { if (!pool.PrepareStatements()) { - TC_LOG_ERROR(_logger, "Could not prepare statements of the %s database, see log for details.", name.c_str()); + TC_LOG_ERROR(_logger, "Could not prepare statements of the {} database, see log for details.", name); return false; } return true; -- cgit v1.2.3