|
|
@ -27,6 +27,7 @@ module.exports = class Logger extends EventEmitter { |
|
|
|
|
|
|
|
// Log buffer
|
|
|
|
this.buf = [] |
|
|
|
this.printed = new Set() |
|
|
|
} |
|
|
|
|
|
|
|
onAuth(callback) { |
|
|
@ -81,7 +82,7 @@ module.exports = class Logger extends EventEmitter { |
|
|
|
this.printLog(b.log) |
|
|
|
} |
|
|
|
this.buf = this.buf.slice(idx) |
|
|
|
}, 300) |
|
|
|
}, 500) |
|
|
|
|
|
|
|
this.buf.push({ log, timer }) |
|
|
|
} |
|
|
@ -112,6 +113,10 @@ module.exports = class Logger extends EventEmitter { |
|
|
|
} |
|
|
|
|
|
|
|
printLog(log) { |
|
|
|
if (this.printed.has(log.id)) return |
|
|
|
|
|
|
|
this.printed.add(log.id) |
|
|
|
|
|
|
|
const data = log.object ? JSON.stringify(log.object) : log.text |
|
|
|
|
|
|
|
if (log.type === 'command') { |
|
|
|