Commit 37b923e9 by Konstantin Käfer

make sure that verbose mode is only applied once

parent 33410a6d
......@@ -48,22 +48,28 @@ Database.prototype.each = function(sql) {
return this;
}
var isVerbose = false;
// Save the stack trace over EIO callbacks.
sqlite3.verbose = function() {
var trace = require('./trace');
trace.extendTrace(Database.prototype, 'prepare');
trace.extendTrace(Database.prototype, 'get');
trace.extendTrace(Database.prototype, 'run');
trace.extendTrace(Database.prototype, 'all');
trace.extendTrace(Database.prototype, 'each');
trace.extendTrace(Database.prototype, 'exec');
trace.extendTrace(Database.prototype, 'close');
trace.extendTrace(Statement.prototype, 'bind');
trace.extendTrace(Statement.prototype, 'get');
trace.extendTrace(Statement.prototype, 'run');
trace.extendTrace(Statement.prototype, 'all');
trace.extendTrace(Statement.prototype, 'each');
trace.extendTrace(Statement.prototype, 'reset');
trace.extendTrace(Statement.prototype, 'finalize');
if (!isVerbose) {
var trace = require('./trace');
trace.extendTrace(Database.prototype, 'prepare');
trace.extendTrace(Database.prototype, 'get');
trace.extendTrace(Database.prototype, 'run');
trace.extendTrace(Database.prototype, 'all');
trace.extendTrace(Database.prototype, 'each');
trace.extendTrace(Database.prototype, 'exec');
trace.extendTrace(Database.prototype, 'close');
trace.extendTrace(Statement.prototype, 'bind');
trace.extendTrace(Statement.prototype, 'get');
trace.extendTrace(Statement.prototype, 'run');
trace.extendTrace(Statement.prototype, 'all');
trace.extendTrace(Statement.prototype, 'each');
trace.extendTrace(Statement.prototype, 'reset');
trace.extendTrace(Statement.prototype, 'finalize');
isVerbose = true;
}
return this;
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment