mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
feat: improve browser logs (#5810)
This commit is contained in:
parent
1f74362d38
commit
09620d58a9
@ -20,6 +20,8 @@ import { createApp, NuxtError } from './index.js'
|
||||
import NuxtLink from './components/nuxt-link.<%= router.prefetchLinks ? "client" : "server" %>.js' // should be included after ./index.js
|
||||
<% if (isDev) { %>import consola from 'consola'<% } %>
|
||||
|
||||
<% if (isDev) { %>consola.wrapConsole()<% } %>
|
||||
|
||||
// Component: <NuxtLink>
|
||||
Vue.component(NuxtLink.name, NuxtLink)
|
||||
Vue.component('NLink', NuxtLink)
|
||||
@ -40,9 +42,8 @@ Object.assign(Vue.config, <%= serialize(vue.config) %>)<%= isTest ? '// eslint-d
|
||||
<% if (nuxtOptions.render.ssrLog) { %>
|
||||
const logs = NUXT.logs || []
|
||||
if (logs.length > 0) {
|
||||
console.group<%= nuxtOptions.render.ssrLog === 'collapsed' ? 'Collapsed' : '' %>("%c🚀 Nuxt.js SSR Logs", 'font-size: 110%')
|
||||
const logger = consola.withScope('nuxt:ssr')
|
||||
logs.forEach(logObj => logger[logObj.type](logObj))
|
||||
console.group<%= nuxtOptions.render.ssrLog === 'collapsed' ? 'Collapsed' : '' %>("%c🚀 Nuxt SSR Logs", 'font-size: 110%')
|
||||
logs.forEach(logObj => consola[logObj.type](logObj))
|
||||
delete NUXT.logs
|
||||
console.groupEnd()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user