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/modules/extra/m_mysql.cpp | 2 +- src/modules/extra/m_pgsql.cpp | 2 +- src/modules/extra/m_sqlite3.cpp | 2 +- src/modules/extra/m_ssl_gnutls.cpp | 4 ++-- src/modules/extra/m_ssl_openssl.cpp | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/modules/extra') 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; } -- cgit v1.3.1-10-gc9f91