Spaces:
Paused
Paused
Download src/debug-mode.js from TomatitoToho/zelin-bot: direct link, hf CLI and curl.
- Browser
- Download file 680 Bytes
-
https://huggingface.co/spaces/TomatitoToho/zelin-bot/resolve/main/src/debug-mode.js
- Command line
-
hf download hf://spaces/TomatitoToho/zelin-bot/src/debug-mode.js
-
curl -L -o debug-mode.js https://huggingface.co/spaces/TomatitoToho/zelin-bot/resolve/main/src/debug-mode.js
680 Bytes
| // src/debug-mode.js | |
| // Shared debug utility for Zelin v5.8 modules | |
| // Enable with ZELIN_DEBUG=1 or ZELIN_DEBUG=true | |
| const DEBUG = process.env.ZELIN_DEBUG === '1' || process.env.ZELIN_DEBUG === 'true'; | |
| export function isDebug() { return DEBUG; } | |
| export function debugLog(prefix, ...args) { | |
| if (!DEBUG) return; | |
| console.log(`[DEBUG:${prefix}]`, ...args); | |
| } | |
| export function debugTrace(prefix, fnName, args = {}) { | |
| if (!DEBUG) return; | |
| console.log(`[TRACE:${prefix}] ${fnName}(${Object.keys(args).join(', ')})`, args); | |
| } | |
| export function debugError(prefix, fnName, error) { | |
| if (!DEBUG) return; | |
| console.error(`[ERR:${prefix}] ${fnName}:`, error.message, error.stack); | |
| } | |