From 93a4f8178c26b0ae894d2060086f605fe22b0a3e Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 14 Jun 2019 14:24:03 +0100 Subject: Log SQL queries at the debug log level. This makes debugging issues easier. --- src/modules/extra/m_mysql.cpp | 1 + src/modules/extra/m_pgsql.cpp | 1 + src/modules/extra/m_sqlite3.cpp | 1 + 3 files changed, 3 insertions(+) (limited to 'src/modules/extra') diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp index 6a9f38b6c..d0ccebc47 100644 --- a/src/modules/extra/m_mysql.cpp +++ b/src/modules/extra/m_mysql.cpp @@ -334,6 +334,7 @@ class SQLConnection : public SQL::Provider void Submit(SQL::Query* q, const std::string& qs) CXX11_OVERRIDE { + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Executing MySQL query: " + qs); Parent()->Dispatcher->LockQueue(); Parent()->qq.push_back(QQueueItem(q, qs, this)); Parent()->Dispatcher->UnlockQueueWakeup(); diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp index aef441e62..3484aeca2 100644 --- a/src/modules/extra/m_pgsql.cpp +++ b/src/modules/extra/m_pgsql.cpp @@ -418,6 +418,7 @@ restart: void Submit(SQL::Query *req, const std::string& q) CXX11_OVERRIDE { + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "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 e81e99025..7807a69f0 100644 --- a/src/modules/extra/m_sqlite3.cpp +++ b/src/modules/extra/m_sqlite3.cpp @@ -174,6 +174,7 @@ class SQLConn : public SQL::Provider void Submit(SQL::Query* query, const std::string& q) CXX11_OVERRIDE { + ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "Executing SQLite3 query: " + q); Query(query, q); delete query; } -- cgit v1.2.3