mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
17 lines
567 B
JavaScript
17 lines
567 B
JavaScript
import { VIETNAM_TIME_ZONE } from "../config/time.js";
|
|
|
|
// Debug logging utility — only active in dev mode (NODE_ENV !== "production")
|
|
// Outputs are tagged with [DBG:tag] for easy grep/filter
|
|
const isDev = process.env.NODE_ENV !== "production";
|
|
|
|
function ts() {
|
|
return new Date().toLocaleTimeString("en-US", { timeZone: VIETNAM_TIME_ZONE, hour12: false, hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
}
|
|
|
|
export function dbg(tag, msg) {
|
|
if (!isDev) return;
|
|
console.log(`[${ts()}] 🐛 [DBG:${tag}] ${msg}`);
|
|
}
|
|
|
|
export const isDebugEnabled = isDev;
|