mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +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 path from 'path'
|
||||||
import crypto from 'crypto'
|
import crypto from 'crypto'
|
||||||
|
import { format } from 'util'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
import consola from 'consola'
|
import consola from 'consola'
|
||||||
import devalue from '@nuxt/devalue'
|
import devalue from '@nuxt/devalue'
|
||||||
@ -42,10 +43,10 @@ export default class SSRRenderer extends BaseRenderer {
|
|||||||
const logs = []
|
const logs = []
|
||||||
const devReporter = {
|
const devReporter = {
|
||||||
log(logObj) {
|
log(logObj) {
|
||||||
if (logObj.args[0] instanceof Error) {
|
logs.push({
|
||||||
logObj.args[0] = logObj.args[0].stack
|
...logObj,
|
||||||
}
|
args: logObj.args.map(format)
|
||||||
logs.push(logObj)
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
consola.addReporter(devReporter)
|
consola.addReporter(devReporter)
|
||||||
|
Loading…
Reference in New Issue
Block a user