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 } }.
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.)
Enabling:
express-vike
). (The current recommendation usespageContext.errorWhileRendering
.)Other condiserations:
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.)