Created
July 7, 2026 14:15
-
-
Save kibotu/4b0d56b8211ead816a44040654f0296f to your computer and use it in GitHub Desktop.
dev logger vite
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const DEV = import.meta.env.DEV; | |
| export const bark = { | |
| error: (...args: unknown[]) => { | |
| if (DEV) { | |
| console.error("[Bark]", ...args); | |
| } | |
| }, | |
| warn: (...args: unknown[]) => { | |
| if (DEV) { | |
| console.warn("[Bark]", ...args); | |
| } | |
| }, | |
| info: (...args: unknown[]) => { | |
| if (DEV) { | |
| console.info("[Bark]", ...args); | |
| } | |
| }, | |
| debug: (...args: unknown[]) => { | |
| if (DEV) { | |
| console.debug("[Bark]", ...args); | |
| } | |
| }, | |
| group: (label: string) => { | |
| if (DEV) { | |
| console.group(`[Bark] ${label}`); | |
| } | |
| }, | |
| groupEnd: () => { | |
| if (DEV) { | |
| console.groupEnd(); | |
| } | |
| }, | |
| } as const; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment