Database logging cancels persistent debug log storage

Database logging is helpful as a debugging tool, but it creates an
infinite loop with the debug log, which wants to write to the database,
which wants to write to the log, which wants to write to the database,
which wants to write to the log, which wants to write to the database,
which wants to write to the log, which wants to write to the database...

// FREEBIE
pull/749/head
lilia 8 years ago committed by Scott Nonnenberg
parent 550b926a15
commit 34042415e9
No known key found for this signature in database
GPG Key ID: A4931C09644C654B

@ -28,7 +28,11 @@
this.fetch({remove: false});
},
log: function(str) {
this.add({time: Date.now(), value: str}).save();
var entry = this.add({time: Date.now(), value: str});
if (window.Whisper.Database.nolog) {
entry.save();
}
while (this.length > MAX_MESSAGES) {
this.at(0).destroy();
}

Loading…
Cancel
Save