diff --git a/include/modules.h b/include/modules.h index 3996ffb8d..50a611437 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1213,7 +1213,7 @@ public: } \ catch (const CoreException& _exception_ ## EVENT) \ { \ - ServerInstance->Logs.Debug("MODULE", _mod->ModuleFile + " threw an exception in " # EVENT ": " + (_exception_ ## EVENT).GetReason()); \ + ServerInstance->Logs.Debug("MODULE", "{} threw an exception in " # EVENT ": {}", _mod->ModuleFile, (_exception_ ## EVENT).GetReason()); \ } \ } \ } while (false) @@ -1240,7 +1240,7 @@ public: } \ catch (const CoreException& _exception_ ## EVENT) \ { \ - ServerInstance->Logs.Debug("MODULE", _mod->ModuleFile + " threw an exception in " # EVENT ": " + (_exception_ ## EVENT).GetReason()); \ + ServerInstance->Logs.Debug("MODULE", "{} threw an exception in " # EVENT ": {}", _mod->ModuleFile, (_exception_ ## EVENT).GetReason()); \ } \ } \ } while (false) diff --git a/src/bancache.cpp b/src/bancache.cpp index 27591f0fa..a26e0ab2d 100644 --- a/src/bancache.cpp +++ b/src/bancache.cpp @@ -58,7 +58,7 @@ bool BanCacheManager::RemoveIfExpired(BanCacheHash::iterator& it) if (ServerInstance->Time() < it->second->Expiry) return false; - ServerInstance->Logs.Debug("BANCACHE", "Hit on " + it->first + " is out of date, removing!"); + ServerInstance->Logs.Debug("BANCACHE", "Hit on {} is out of date, removing!", it->first); delete it->second; it = BanHash.erase(it); return true; @@ -67,7 +67,7 @@ bool BanCacheManager::RemoveIfExpired(BanCacheHash::iterator& it) void BanCacheManager::RemoveEntries(const std::string& type, bool positive) { if (positive) - ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing positive hits for " + type); + ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing positive hits for {}", type); else ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing all negative hits"); @@ -93,7 +93,7 @@ void BanCacheManager::RemoveEntries(const std::string& type, bool positive) if (remove) { /* we need to remove this one. */ - ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing a hit on " + i->first); + ServerInstance->Logs.Debug("BANCACHE", "BanCacheManager::RemoveEntries(): Removing a hit on {}", i->first); delete b; i = BanHash.erase(i); } diff --git a/src/channels.cpp b/src/channels.cpp index 66cc2150c..d663ecb37 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -167,7 +167,7 @@ Membership* Channel::JoinUser(LocalUser* user, std::string cname, bool override, { if (!user->IsFullyConnected()) { - ServerInstance->Logs.Debug("CHANNELS", "Attempted to join partially connected user " + user->uuid + " to channel " + cname); + ServerInstance->Logs.Debug("CHANNELS", "Attempted to join partially connected user {} to channel {}", user->uuid, cname); return nullptr; } @@ -217,7 +217,7 @@ Membership* Channel::ForceJoin(User* user, const std::string* privs, bool bursti { if (IS_SERVER(user)) { - ServerInstance->Logs.Debug("CHANNELS", "Attempted to join server user " + user->uuid + " to channel " + this->name); + ServerInstance->Logs.Debug("CHANNELS", "Attempted to join server user {} to channel {}", user->uuid, this->name); return nullptr; } diff --git a/src/configreader.cpp b/src/configreader.cpp index 15ddb1409..804406ec4 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -740,7 +740,7 @@ void ConfigReaderThread::OnStop() { try { - ServerInstance->Logs.Debug("MODULE", "Rehashing " + modname); + ServerInstance->Logs.Debug("MODULE", "Rehashing {}", modname); mod->ReadConfig(status); } catch (const CoreException& modex) diff --git a/src/coremods/core_channel/cmd_kick.cpp b/src/coremods/core_channel/cmd_kick.cpp index 07a4fc12a..83916fa3b 100644 --- a/src/coremods/core_channel/cmd_kick.cpp +++ b/src/coremods/core_channel/cmd_kick.cpp @@ -85,7 +85,8 @@ CmdResult CommandKick::Handle(User* user, const Params& parameters) // If the current membership id is not equal to the one in the message then the user rejoined if (memb->id != Membership::IdFromString(parameters[2])) { - ServerInstance->Logs.Debug(MODNAME, "Dropped KICK due to membership id mismatch: " + ConvToStr(memb->id) + " != " + parameters[2]); + ServerInstance->Logs.Debug(MODNAME, "Dropped KICK due to membership id mismatch: {} != {}", + memb->id, parameters[2]); return CmdResult::FAILURE; } } diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp index 0caa67ce7..78d061ec8 100644 --- a/src/coremods/core_dns.cpp +++ b/src/coremods/core_dns.cpp @@ -55,7 +55,7 @@ private: if (pos + name.length() + 2 > output_size) throw Exception(creator, "Unable to pack name"); - ServerInstance->Logs.Debug(MODNAME, "Packing name " + name); + ServerInstance->Logs.Debug(MODNAME, "Packing name {}", name); irc::sepstream sep(name, '.'); std::string token; @@ -127,7 +127,7 @@ private: if (name.empty()) throw Exception(creator, "Unable to unpack name - no name"); - ServerInstance->Logs.Debug(MODNAME, "Unpack name " + name); + ServerInstance->Logs.Debug(MODNAME, "Unpack name {}", name); return name; } @@ -250,7 +250,7 @@ private: } if (!record.name.empty() && !record.rdata.empty()) - ServerInstance->Logs.Debug(MODNAME, record.name + " -> " + record.rdata); + ServerInstance->Logs.Debug(MODNAME, "{} -> {}", record.name, record.rdata); return record; } @@ -296,7 +296,8 @@ public: unsigned short arcount = (input[packet_pos] << 8) | input[packet_pos + 1]; packet_pos += 2; - ServerInstance->Logs.Debug(MODNAME, "qdcount: " + ConvToStr(qdcount) + " ancount: " + ConvToStr(ancount) + " nscount: " + ConvToStr(nscount) + " arcount: " + ConvToStr(arcount)); + ServerInstance->Logs.Debug(MODNAME, "qdcount: {} ancount: {} nscount: {} arcount: {}", + qdcount, ancount, nscount, arcount); if (qdcount != 1) throw Exception(creator, "Question count != 1 in incoming packet"); @@ -407,7 +408,7 @@ class MyManager final */ bool CheckCache(DNS::Request* req, const DNS::Question& question) { - ServerInstance->Logs.Critical(MODNAME, "cache: Checking cache for " + question.name); + ServerInstance->Logs.Critical(MODNAME, "cache: Checking cache for {}", question.name); cache_map::iterator it = this->cache.find(question); if (it == this->cache.end()) @@ -420,7 +421,7 @@ class MyManager final return false; } - ServerInstance->Logs.Debug(MODNAME, "cache: Using cached result for " + question.name); + ServerInstance->Logs.Debug(MODNAME, "cache: Using cached result for {}", question.name); record.cached = true; req->OnLookupComplete(&record); return true; @@ -446,7 +447,7 @@ class MyManager final ResourceRecord& rr = r.answers.front(); // Set TTL to what we've determined to be the lowest rr.ttl = cachettl; - ServerInstance->Logs.Debug(MODNAME, "cache: added cache for " + rr.name + " -> " + rr.rdata + " ttl: " + ConvToStr(rr.ttl)); + ServerInstance->Logs.Debug(MODNAME, "cache: added cache for {} -> {} ttl: {}", rr.name, rr.rdata, rr.ttl); this->cache[r.question] = r; } @@ -511,7 +512,8 @@ public: return; } - ServerInstance->Logs.Debug(MODNAME, "Processing request to lookup " + req->question.name + " of type " + ConvToStr(req->question.type) + " to " + this->myserver.addr()); + ServerInstance->Logs.Debug(MODNAME, "Processing request to lookup {} of type {} to {}", + req->question.name, (int)req->question.type, this->myserver.addr()); /* Create an id */ unsigned int tries = 0; @@ -740,7 +742,7 @@ public: } else { - ServerInstance->Logs.Debug(MODNAME, "Lookup complete for " + request->question.name); + ServerInstance->Logs.Debug(MODNAME, "Lookup complete for {}", request->question.name); this->stats_success++; request->OnLookupComplete(&recv_packet); this->AddCache(recv_packet); diff --git a/src/coremods/core_hostname_lookup.cpp b/src/coremods/core_hostname_lookup.cpp index 62a7af651..f1f2e1ebc 100644 --- a/src/coremods/core_hostname_lookup.cpp +++ b/src/coremods/core_hostname_lookup.cpp @@ -187,7 +187,7 @@ public: catch (const DNS::Exception& e) { delete res_forward; - ServerInstance->Logs.Debug(MODNAME, "Error in resolver: " + e.GetReason()); + ServerInstance->Logs.Debug(MODNAME, "Error in resolver: {}", e.GetReason()); HandleError(user, "There was an internal error resolving your host"); } @@ -236,7 +236,7 @@ public: { this->dnsLookup.Unset(user); delete res_reverse; - ServerInstance->Logs.Debug(MODNAME, "Error in resolver: " + e.GetReason()); + ServerInstance->Logs.Debug(MODNAME, "Error in resolver: {}", e.GetReason()); } } diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index ae6a27a9d..ec3acd09a 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -427,7 +427,7 @@ public: void Submit(SQL::Query* q, const std::string& qs) override { - ServerInstance->Logs.Debug(MODNAME, "Executing MySQL query: " + qs); + ServerInstance->Logs.Debug(MODNAME, "Executing MySQL query: {}", qs); Parent()->Dispatcher->LockQueue(); Parent()->qq.emplace_back(q, qs, this); Parent()->Dispatcher->UnlockQueueWakeup(); diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index 0512ab772..228e28b83 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -454,7 +454,7 @@ restart: void Submit(SQL::Query* req, const std::string& q) override { - ServerInstance->Logs.Debug(MODNAME, "Executing PostgreSQL query: " + q); + ServerInstance->Logs.Debug(MODNAME, "Executing PostgreSQL query: {}", q); if (qinprog.q.empty()) { DoQuery(QueueItem(req, q)); diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp index 0843e20be..246f65a8e 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -174,7 +174,7 @@ public: void Submit(SQL::Query* query, const std::string& q) override { - ServerInstance->Logs.Debug(MODNAME, "Executing SQLite3 query: " + q); + ServerInstance->Logs.Debug(MODNAME, "Executing SQLite3 query: {}", q); Query(query, q); delete query; } diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 8ceb63a61..2b9fdfdab 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -1148,14 +1148,14 @@ class ModuleSSLGnuTLS final { if (!insp::equalsci(tag->getString("provider", "gnutls", 1), "gnutls")) { - ServerInstance->Logs.Debug(MODNAME, "Ignoring non-GnuTLS tag at " + tag->source.str()); + ServerInstance->Logs.Debug(MODNAME, "Ignoring non-GnuTLS tag at {}", tag->source.str()); continue; } const std::string name = tag->getString("name"); if (name.empty()) { - ServerInstance->Logs.Warning(MODNAME, "Ignoring tag without name at " + tag->source.str()); + ServerInstance->Logs.Warning(MODNAME, "Ignoring tag without name at {}", tag->source.str()); continue; } diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index 4cda94494..5c43ad6bb 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -987,14 +987,14 @@ class ModuleSSLOpenSSL final { if (!insp::equalsci(tag->getString("provider", "openssl", 1), "openssl")) { - ServerInstance->Logs.Debug(MODNAME, "Ignoring non-OpenSSL tag at " + tag->source.str()); + ServerInstance->Logs.Debug(MODNAME, "Ignoring non-OpenSSL tag at {}", tag->source.str()); continue; } const std::string name = tag->getString("name"); if (name.empty()) { - ServerInstance->Logs.Warning(MODNAME, "Ignoring tag without name at " + tag->source.str()); + ServerInstance->Logs.Warning(MODNAME, "Ignoring tag without name at {}", tag->source.str()); continue; } diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 8fe610e7a..35a763914 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -780,7 +780,7 @@ void ModuleFilter::OnDecodeMetadata(Extensible* target, const std::string& extna } catch (const ModuleException& e) { - ServerInstance->Logs.Debug(MODNAME, "Error when unserializing filter: " + e.GetReason()); + ServerInstance->Logs.Debug(MODNAME, "Error when unserializing filter: {}", e.GetReason()); } } } diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index a35e5eb30..92723fe07 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -347,7 +347,7 @@ public: } catch (const ModuleException& e) { - ServerInstance->Logs.Debug(MODNAME, "Ident exception: " + e.GetReason()); + ServerInstance->Logs.Debug(MODNAME, "Ident exception: {}", e.GetReason()); } } diff --git a/src/modules/m_spanningtree/ijoin.cpp b/src/modules/m_spanningtree/ijoin.cpp index 22f3c28c6..444d7e8ed 100644 --- a/src/modules/m_spanningtree/ijoin.cpp +++ b/src/modules/m_spanningtree/ijoin.cpp @@ -31,7 +31,7 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, Params& params) { // Desync detected, recover // Ignore the join and send RESYNC, this will result in the remote server sending all channel data to us - ServerInstance->Logs.Debug(MODNAME, "Received IJOIN for nonexistent channel: " + params[0]); + ServerInstance->Logs.Debug(MODNAME, "Received IJOIN for nonexistent channel: {}", params[0]); CmdBuilder("RESYNC").push(params[0]).Unicast(user); @@ -58,7 +58,7 @@ CmdResult CommandIJoin::HandleRemote(RemoteUser* user, Params& params) CmdResult CommandResync::HandleServer(TreeServer* server, CommandBase::Params& params) { - ServerInstance->Logs.Debug(MODNAME, "Resyncing " + params[0]); + ServerInstance->Logs.Debug(MODNAME, "Resyncing {}", params[0]); auto* chan = ServerInstance->Channels.Find(params[0]); if (!chan) { diff --git a/src/modules/m_spanningtree/sinfo.cpp b/src/modules/m_spanningtree/sinfo.cpp index d1fcc7856..09e654b3b 100644 --- a/src/modules/m_spanningtree/sinfo.cpp +++ b/src/modules/m_spanningtree/sinfo.cpp @@ -35,7 +35,8 @@ CmdResult CommandSInfo::HandleServer(TreeServer* server, CommandBase::Params& pa else if (irc::equals(key, "desc")) { // Only sent when the description of a server changes because of a rehash; not sent on burst - ServerInstance->Logs.Debug(MODNAME, "Server description of " + server->GetName() + " changed: " + value); + ServerInstance->Logs.Debug(MODNAME, "Server description of {} changed: {}", + server->GetName(), value); server->SetDesc(value); } else if (irc::equals(key, "rawbranch")) 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(); diff --git a/src/users.cpp b/src/users.cpp index 7db26cfb5..d565af287 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -483,7 +483,7 @@ void LocalUser::FullConnect() ServerInstance->SNO.WriteToSnoMask('c', "Client connecting on port {} (class {}): {} ({}) [{}\x0F]", server_sa.port(), GetClass()->GetName(), GetRealMask(), GetAddress(), GetRealName()); - ServerInstance->Logs.Debug("BANCACHE", "Adding NEGATIVE hit for " + this->GetAddress()); + ServerInstance->Logs.Debug("BANCACHE", "Adding NEGATIVE hit for {}", this->GetAddress()); ServerInstance->BanCache.AddHit(this->GetAddress(), "", ""); // reset the flood penalty (which could have been raised due to things like auto +x) CommandFloodPenalty = 0; @@ -504,7 +504,7 @@ bool User::ChangeNick(const std::string& newnick, time_t newts) { if (quitting) { - ServerInstance->Logs.Debug("USERS", "BUG: Attempted to change nick of a quitting user: " + this->nick); + ServerInstance->Logs.Debug("USERS", "BUG: Attempted to change nick of a quitting user: {}", this->nick); return false; } diff --git a/src/xline.cpp b/src/xline.cpp index 32a6fd1a8..ec3178f70 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -577,7 +577,7 @@ void XLine::DefaultApply(User* u, bool bancache) if (bancache) { - ServerInstance->Logs.Debug("BANCACHE", "Adding positive hit (" + type + ") for " + u->GetAddress()); + ServerInstance->Logs.Debug("BANCACHE", "Adding positive hit ({}) for {}", type, u->GetAddress()); ServerInstance->BanCache.AddHit(u->GetAddress(), this->type, banreason, (this->duration > 0 ? (this->expiry - ServerInstance->Time()) : 0)); } }