17#include "moc_qgsdbquerylog.cpp"
27QAtomicInt QgsDatabaseQueryLogEntry::sQueryId = 0;
30 : queryId( ++sQueryId )
32 , startedTime( QDateTime::currentMSecsSinceEpoch() )
40bool QgsDatabaseQueryLog::sEnabled =
false;
63 finishedQuery.
finishedTime = QDateTime::currentMSecsSinceEpoch();
static QgsDatabaseQueryLog * databaseQueryLog()
Returns the database query log.
Encapsulates a logged database query.
quint64 finishedTime
Time when the query finished (in milliseconds since epoch), if available.
QString query
The logged database query (e.g. the SQL query)
QgsDatabaseQueryLogEntry(const QString &query=QString())
Constructor for QgsDatabaseQueryLogEntry.
static void log(const QgsDatabaseQueryLogEntry &query)
Logs a database query as starting.
void queryFinished(const QgsDatabaseQueryLogEntry &query)
Emitted whenever a database query has finished executing.
static void finished(const QgsDatabaseQueryLogEntry &query)
Records that the database query has finished.
void queryStarted(const QgsDatabaseQueryLogEntry &query)
Emitted whenever a database query is started.
void queryFinishedPrivate(const QgsDatabaseQueryLogEntry &query)
Internal slot for logging queries as finished.
void queryStartedPrivate(const QgsDatabaseQueryLogEntry &query)
Internal slot for logging queries as start.
QgsDatabaseQueryLog(QObject *parent=nullptr)
Creates a new query log.
#define QgsDebugMsgLevel(str, level)