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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user