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:
parent
550b926a15
commit
34042415e9
1 changed files with 5 additions and 1 deletions
|
@ -28,7 +28,11 @@
|
||||||
this.fetch({remove: false});
|
this.fetch({remove: false});
|
||||||
},
|
},
|
||||||
log: function(str) {
|
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) {
|
while (this.length > MAX_MESSAGES) {
|
||||||
this.at(0).destroy();
|
this.at(0).destroy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue