1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Various terminal gui changes

This commit is contained in:
Laurent Cozic
2017-10-07 17:30:27 +01:00
parent 2b83ddc273
commit 824b385e83
20 changed files with 458 additions and 405 deletions

View File

@ -12,6 +12,11 @@ class Database {
this.inTransaction_ = false;
this.logger_ = new Logger();
this.logExcludedQueryTypes_ = [];
}
setLogExcludedQueryTypes(v) {
this.logExcludedQueryTypes_ = v;
}
// Converts the SQLite error to a regular JS error
@ -185,6 +190,13 @@ class Database {
}
logQuery(sql, params = null) {
if (this.logExcludedQueryTypes_.length) {
const temp = sql.toLowerCase();
for (let i = 0; i < this.logExcludedQueryTypes_.length; i++) {
if (temp.indexOf(this.logExcludedQueryTypes_[i].toLowerCase()) === 0) return;
}
}
this.logger().debug(sql);
if (params !== null && params.length) this.logger().debug(JSON.stringify(params));
}