fix: 定时任务不显示堆栈异常的情况

(cherry picked commit from <gitee.com//continew/continew-admin-ui/commit/eb2c9a28afe12a2964ce6c5483550adf7966b89a>
This commit is contained in:
KAI
2024-09-26 14:28:50 +08:00
committed by Charles7c
parent 07294cce14
commit 44ef90917f

View File

@@ -71,7 +71,12 @@ const visible = ref(false)
// 格式化日志
const formatLog = (log: any) => {
const date = new Date(Number.parseInt(log.time_stamp))
return `${dayjs(date).format('YYYY-MM-DD HH:mm:ss')} ${log.level} [${log.thread}] ${log.location} - ${log.message}`
let formatLog = `${dayjs(date).format('YYYY-MM-DD HH:mm:ss')} ${log.level} [${log.thread}] ${log.location} - ${log.message}`
// 增加堆栈信息显示
if (log.throwable) {
formatLog += `\n ${log.throwable}`
}
return formatLog
}
const content = ref('')