]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Log SQL queries at the debug log level.
authorPeter Powell <petpow@saberuk.com>
Fri, 14 Jun 2019 13:24:03 +0000 (14:24 +0100)
committerPeter Powell <petpow@saberuk.com>
Fri, 14 Jun 2019 13:40:19 +0000 (14:40 +0100)
This makes debugging issues easier.

src/modules/extra/m_mysql.cpp
src/modules/extra/m_pgsql.cpp
src/modules/extra/m_sqlite3.cpp

index 6a9f38b6c62676a0c461c970ec636603be6abb5b..d0ccebc478550037a05a91f7d59463fe53ae3dd2 100644 (file)
@@ -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();
index aef441e62b1689b1d7eb12a615530fed44fb6db7..3484aeca2bd52daea4ba23c1064942581bab7ee7 100644 (file)
@@ -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));
index e81e990252c7e9b115f1865c6b3fe038306e1bec..7807a69f032b257a9e400026a56cbf923f2050ec 100644 (file)
@@ -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;
        }