Commit 37b923e9 by Konstantin Käfer

make sure that verbose mode is only applied once

parent 33410a6d
...@@ -48,8 +48,11 @@ Database.prototype.each = function(sql) { ...@@ -48,8 +48,11 @@ Database.prototype.each = function(sql) {
return this; return this;
} }
var isVerbose = false;
// Save the stack trace over EIO callbacks. // Save the stack trace over EIO callbacks.
sqlite3.verbose = function() { sqlite3.verbose = function() {
if (!isVerbose) {
var trace = require('./trace'); var trace = require('./trace');
trace.extendTrace(Database.prototype, 'prepare'); trace.extendTrace(Database.prototype, 'prepare');
trace.extendTrace(Database.prototype, 'get'); trace.extendTrace(Database.prototype, 'get');
...@@ -65,5 +68,8 @@ sqlite3.verbose = function() { ...@@ -65,5 +68,8 @@ sqlite3.verbose = function() {
trace.extendTrace(Statement.prototype, 'each'); trace.extendTrace(Statement.prototype, 'each');
trace.extendTrace(Statement.prototype, 'reset'); trace.extendTrace(Statement.prototype, 'reset');
trace.extendTrace(Statement.prototype, 'finalize'); trace.extendTrace(Statement.prototype, 'finalize');
isVerbose = true;
}
return this; 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