mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 10:04:39 +02:00
Setup onLog event, add app version & platform to logs and share filename
This commit is contained in:
parent
fe921fd5b1
commit
26b0fae0fb
6 changed files with 61 additions and 9 deletions
|
@ -117,7 +117,7 @@ export default {
|
|||
const base64Data = Buffer.from(this.getLogsString()).toString('base64')
|
||||
|
||||
FileSharer.share({
|
||||
filename: `audiobookshelf_logs.txt`,
|
||||
filename: `abs_logs_${this.$platform}_${this.$config.version}.txt`,
|
||||
contentType: 'text/plain',
|
||||
base64Data
|
||||
}).catch((error) => {
|
||||
|
@ -156,7 +156,19 @@ export default {
|
|||
}
|
||||
},
|
||||
mounted() {
|
||||
AbsLogger.addListener('onLog', (log) => {
|
||||
log.maskedMessage = this.maskLogMessage(log.message)
|
||||
this.logs.push(log)
|
||||
this.logs.sort((a, b) => a.timestamp - b.timestamp)
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.scrollToBottom()
|
||||
})
|
||||
})
|
||||
this.loadLogs()
|
||||
},
|
||||
beforeDestroy() {
|
||||
AbsLogger.removeAllListeners()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue