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

New hook onLog() #1438

Open
brillout opened this issue Jan 15, 2024 · 1 comment
Open

New hook onLog() #1438

brillout opened this issue Jan 15, 2024 · 1 comment
Labels
enhancement ✨ New feature or request high-prio 💫

Comments

@brillout
Copy link
Member

brillout commented Jan 15, 2024

Enabling:

  • Control over what Vike logs, most notably what warnings are shown.
  • Completely silence Vike.
  • Verbose logging in production (like in dev).
  • More precise error tracking.
  • Error tracking regardless of server integration (important for upcoming middleware packages such as express-vike). (The current recommendation uses pageContext.errorWhileRendering.)

Other condiserations:

  • A new setting interceptLogs would be neat for easily track errors in an exhaustive fashion (also for manipulating logs coming from other tools). With fine grain control over what is intercepted: interceptLogs: boolean | { client?: boolean, server?: boolean } | { logs: { client: boolean, server: boolean }, errors: { client: boolean, server: boolean } }.

See also:

Instead of having three different hooks (onLog() / onClientLog() / onServerLog()), a consideration is to have +onLog.js / +onLog.server.js / +onLog.client.js. (The suffixes would automatically change the env of the + file.)

@brillout brillout added the enhancement ✨ New feature or request label Jan 15, 2024
@brillout brillout changed the title New hooks onLog / onClientLog / onServerLog New hook onLog Jan 15, 2024
@brillout brillout changed the title New hook onLog New hook onLog() Jan 15, 2024
@chrisvander
Copy link

Sweet!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request high-prio 💫
Projects
None yet
Development

No branches or pull requests

2 participants