Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(vue-app): add group for ssr logs #5770

Merged
merged 2 commits into from
May 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions packages/vue-app/template/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ const NUXT = window.<%= globals.context %> || {}
Object.assign(Vue.config, <%= serialize(vue.config) %>)<%= isTest ? '// eslint-disable-line' : '' %>

<% if (isDev) { %>
const logger = consola.withScope('nuxt:ssr')
const logs = NUXT.logs || []
logs.forEach(logObj => logger[logObj.type](logObj))
delete NUXT.logs
if (logs.length > 0) {
console.group("%c🚀 Nuxt.js SSR Logs", 'font-size: 110%')
const logger = consola.withScope('nuxt:ssr')
logs.forEach(logObj => logger[logObj.type](logObj))
delete NUXT.logs
console.groupEnd()
}
<% } %>
<% if (debug) { %>
// Setup global Vue error handler
Expand Down