Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves #25260
resolves #13470

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR adds a new feature (can be disabled by setting features.devLogs to false) which records all console events on the server (nitro runtime + vue runtime). It bundles up logs to the next request, and then continues to stream them to the client. Any logs that don't happen on the client are displayed in the console.

A hook (which I envision being consumed by devtools - cc: @antfu) is called whenever new logs are available.

You can currently set features.devLogs to silent to disable them being output to the browser console while still being able to consume them in devtools, or elsewhere. I'm wondering if it makes sense for this to be the default, so things are less 'noisy'... (Thoughts very much welcome!)

Here's a demo of logs being consumed by a custom hook + vue-sonner:

CleanShot.2024-02-23.at.17.34.12.mp4

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

nuxt-studio bot commented Feb 23, 2024

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview 96b8d40

@atinux
Copy link
Member

atinux commented Feb 23, 2024

/trigger release

Copy link
Contributor

πŸš€ Release triggered! You can now install nuxt@npm:nuxt-nightly@pr-25936

@danielroe danielroe requested a review from antfu February 27, 2024 09:12
@atinux
Copy link
Member

atinux commented Feb 27, 2024

/trigger release

Copy link
Contributor

πŸš€ Release triggered! You can now install nuxt@npm:nuxt-nightly@pr-25936

@danielroe
Copy link
Member Author

/trigger release

Copy link
Contributor

πŸš€ Release triggered! You can now install nuxt@npm:nuxt-nightly@pr-25936

@atinux atinux changed the title feat(nuxt): pass + stream server logs to client feat(nuxt): pass server logs to client Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DX: Forward SSR logs in development back to the browser console Show SSR logs in client console (including errors and warns)
3 participants