Download client/src/utils/logger.ts from Zhitomir/chat: direct link, hf CLI and curl.
- Browser
- Download file 886 Bytes
-
https://huggingface.co/spaces/Zhitomir/chat/resolve/main/client/src/utils/logger.ts
- Command line
-
hf download hf://spaces/Zhitomir/chat/client/src/utils/logger.ts
-
curl -L -o logger.ts https://huggingface.co/spaces/Zhitomir/chat/resolve/main/client/src/utils/logger.ts
886 Bytes
| const isDevelopment = import.meta.env.MODE === 'development'; | |
| const isLoggerEnabled = import.meta.env.VITE_ENABLE_LOGGER === 'true'; | |
| const logger = { | |
| log: (...args: unknown[]) => { | |
| if (isDevelopment || isLoggerEnabled) { | |
| console.log(...args); | |
| } | |
| }, | |
| warn: (...args: unknown[]) => { | |
| if (isDevelopment || isLoggerEnabled) { | |
| console.warn(...args); | |
| } | |
| }, | |
| error: (...args: unknown[]) => { | |
| if (isDevelopment || isLoggerEnabled) { | |
| console.error(...args); | |
| } | |
| }, | |
| info: (...args: unknown[]) => { | |
| if (isDevelopment || isLoggerEnabled) { | |
| console.info(...args); | |
| } | |
| }, | |
| debug: (...args: unknown[]) => { | |
| if (isDevelopment || isLoggerEnabled) { | |
| console.debug(...args); | |
| } | |
| }, | |
| dir: (...args: unknown[]) => { | |
| if (isDevelopment || isLoggerEnabled) { | |
| console.dir(...args); | |
| } | |
| }, | |
| }; | |
| export default logger; | |