From b9fee8b43dc1903ecb08c81405fb83295fc64db9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 23 Jan 2025 16:35:32 +0000 Subject: Convert debug logging from string concatenation to format strings. When running in normal mode this will prevent a bunch of expensive string concatenation. --- src/usermanager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/usermanager.cpp') diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 26ec95774..f2384e0a4 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -200,7 +200,7 @@ void UserManager::AddUser(int socket, ListenSocket* via, const irc::sockets::soc if (!b->Type.empty() && !New->exempt) { /* user banned */ - ServerInstance->Logs.Debug("BANCACHE", "Positive hit for " + New->GetAddress()); + ServerInstance->Logs.Debug("BANCACHE", "Positive hit for {}", New->GetAddress()); if (!ServerInstance->Config->XLineMessage.empty()) New->WriteNumeric(ERR_YOUREBANNEDCREEP, ServerInstance->Config->XLineMessage); @@ -212,7 +212,7 @@ void UserManager::AddUser(int socket, ListenSocket* via, const irc::sockets::soc } else { - ServerInstance->Logs.Debug("BANCACHE", "Negative hit for " + New->GetAddress()); + ServerInstance->Logs.Debug("BANCACHE", "Negative hit for {}", New->GetAddress()); } } else @@ -241,13 +241,13 @@ void UserManager::QuitUser(User* user, const std::string& quitmessage, const std { if (user->quitting) { - ServerInstance->Logs.Debug("USERS", "BUG: Tried to quit quitting user: " + user->nick); + ServerInstance->Logs.Debug("USERS", "BUG: Tried to quit quitting user: {}", user->nick); return; } if (IS_SERVER(user)) { - ServerInstance->Logs.Debug("USERS", "BUG: Tried to quit server user: " + user->nick); + ServerInstance->Logs.Debug("USERS", "BUG: Tried to quit server user: {}", user->nick); return; } @@ -308,7 +308,7 @@ void UserManager::QuitUser(User* user, const std::string& quitmessage, const std } if (!clientlist.erase(user->nick)) - ServerInstance->Logs.Debug("USERS", "BUG: Nick not found in clientlist, cannot remove: " + user->nick); + ServerInstance->Logs.Debug("USERS", "BUG: Nick not found in clientlist, cannot remove: {}", user->nick); uuidlist.erase(user->uuid); user->PurgeEmptyChannels(); -- cgit v1.3.1-10-gc9f91