aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/coreSQLiteStudio/log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/log.cpp')
-rw-r--r--SQLiteStudio3/coreSQLiteStudio/log.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/log.cpp b/SQLiteStudio3/coreSQLiteStudio/log.cpp
index d54abdb..d45f1aa 100644
--- a/SQLiteStudio3/coreSQLiteStudio/log.cpp
+++ b/SQLiteStudio3/coreSQLiteStudio/log.cpp
@@ -1,9 +1,11 @@
#include "log.h"
+#include "db/queryexecutorsteps/queryexecutorstep.h"
#include <QTime>
#include <QDebug>
-bool SQL_DEBUG = false;
-QString SQL_DEBUG_FILTER = "";
+static bool SQL_DEBUG = false;
+static bool EXECUTOR_DEBUG = false;
+static QString SQL_DEBUG_FILTER = "";
void setSqlLoggingEnabled(bool enabled)
{
@@ -45,3 +47,25 @@ void logSql(Db* db, const QString& str, const QList<QVariant>& args, Db::Flags f
foreach (const QVariant& arg, args)
qDebug() << " SQL arg>" << i++ << "=" << arg;
}
+
+void setExecutorLoggingEnabled(bool enabled)
+{
+ EXECUTOR_DEBUG = enabled;
+}
+
+void logExecutorStep(QueryExecutorStep* step)
+{
+ if (!EXECUTOR_DEBUG)
+ return;
+
+ qDebug() << "Executing step:" << step->metaObject()->className() << step->objectName();
+}
+
+
+void logExecutorAfterStep(const QString& str)
+{
+ if (!EXECUTOR_DEBUG)
+ return;
+
+ qDebug() << str;
+}