Setup onLog event, add app version & platform to logs and share filename

This commit is contained in:
advplyr 2025-04-20 14:33:48 -05:00
parent fe921fd5b1
commit 26b0fae0fb
6 changed files with 61 additions and 9 deletions

View file

@ -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>