aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2025-01-23 16:35:32 +0000
committerGravatar Sadie Powell2025-01-23 16:35:32 +0000
commitb9fee8b43dc1903ecb08c81405fb83295fc64db9 (patch)
tree80d4bb49c9a2e0e36be0e348a3900d7bec2b7da5 /src/modules
parentFix the list of supported exemptions. (diff)
Convert debug logging from string concatenation to format strings.
When running in normal mode this will prevent a bunch of expensive string concatenation.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/extra/m_mysql.cpp2
-rw-r--r--src/modules/extra/m_pgsql.cpp2
-rw-r--r--src/modules/extra/m_sqlite3.cpp2
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp4
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp4
-rw-r--r--src/modules/m_filter.cpp2
-rw-r--r--src/modules/m_ident.cpp2
-rw-r--r--src/modules/m_spanningtree/ijoin.cpp4
-rw-r--r--src/modules/m_spanningtree/sinfo.cpp3
9 files changed, 13 insertions, 12 deletions
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 <sslprofile> tag at " + tag->source.str());
+ ServerInstance->Logs.Debug(MODNAME, "Ignoring non-GnuTLS <sslprofile> tag at {}", tag->source.str());
continue;
}
const std::string name = tag->getString("name");
if (name.empty())
{
- ServerInstance->Logs.Warning(MODNAME, "Ignoring <sslprofile> tag without name at " + tag->source.str());
+ ServerInstance->Logs.Warning(MODNAME, "Ignoring <sslprofile> 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 <sslprofile> tag at " + tag->source.str());
+ ServerInstance->Logs.Debug(MODNAME, "Ignoring non-OpenSSL <sslprofile> tag at {}", tag->source.str());
continue;
}
const std::string name = tag->getString("name");
if (name.empty())
{
- ServerInstance->Logs.Warning(MODNAME, "Ignoring <sslprofile> tag without name at " + tag->source.str());
+ ServerInstance->Logs.Warning(MODNAME, "Ignoring <sslprofile> 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"))