mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix(vue-renderer): safe format ssr logs (#5764)
This commit is contained in:
parent
dbb9f03959
commit
38fc721f50
@ -1,5 +1,6 @@
|
||||
import path from 'path'
|
||||
import crypto from 'crypto'
|
||||
import { format } from 'util'
|
||||
import fs from 'fs-extra'
|
||||
import consola from 'consola'
|
||||
import devalue from '@nuxt/devalue'
|
||||
@ -42,10 +43,10 @@ export default class SSRRenderer extends BaseRenderer {
|
||||
const logs = []
|
||||
const devReporter = {
|
||||
log(logObj) {
|
||||
if (logObj.args[0] instanceof Error) {
|
||||
logObj.args[0] = logObj.args[0].stack
|
||||
}
|
||||
logs.push(logObj)
|
||||
logs.push({
|
||||
...logObj,
|
||||
args: logObj.args.map(format)
|
||||
})
|
||||
}
|
||||
}
|
||||
consola.addReporter(devReporter)
|
||||
|
Loading…
Reference in New Issue
Block a user