mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Keep the logs if no store exists
This commit is contained in:
parent
ea063ab8b0
commit
2ecf65f057
@ -80,11 +80,15 @@ class ConsoleLogger {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve log lines to flush to disk.
|
* Retrieve log lines to flush to disk.
|
||||||
|
* @param {boolean} keepLogs True to not delete logs after flushing.
|
||||||
* @return {string} \n delimited log lines to flush.
|
* @return {string} \n delimited log lines to flush.
|
||||||
*/
|
*/
|
||||||
flush() {
|
flush(keepLogs) {
|
||||||
// The ConsoleLogger doesn't care how these end up on disk, it just
|
// The ConsoleLogger doesn't care how these end up on disk, it just
|
||||||
// flushes them to the caller.
|
// flushes them to the caller.
|
||||||
|
if (keepLogs) {
|
||||||
|
return this.logs;
|
||||||
|
}
|
||||||
const logsToFlush = this.logs;
|
const logsToFlush = this.logs;
|
||||||
this.logs = "";
|
this.logs = "";
|
||||||
return logsToFlush;
|
return logsToFlush;
|
||||||
@ -470,7 +474,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logs.push({
|
logs.push({
|
||||||
lines: logger.flush(),
|
lines: logger.flush(true),
|
||||||
id: "-",
|
id: "-",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user