Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
File size: 405 Bytes
d15f07c | 1 2 3 4 5 6 7 8 9 10 11 | /** Set `VITE_DEBUG_HOME=true` in `.env.local` to enable Home page trace logs. */
export function createDevLogger(envFlag: string): (...args: unknown[]) => void {
const enabled =
import.meta.env.DEV && import.meta.env[envFlag as keyof ImportMetaEnv] === 'true'
return (...args: unknown[]) => {
if (enabled) console.log(...args)
}
}
export const homeLog = createDevLogger('VITE_DEBUG_HOME')
|