Skip to content

Instantly share code, notes, and snippets.

@kibotu
Created July 7, 2026 14:15
Show Gist options
  • Select an option

  • Save kibotu/4b0d56b8211ead816a44040654f0296f to your computer and use it in GitHub Desktop.

Select an option

Save kibotu/4b0d56b8211ead816a44040654f0296f to your computer and use it in GitHub Desktop.
dev logger vite
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