Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Thomas G. Lopes
commited on
Commit
·
be61c3d
1
Parent(s):
57e5e86
improve log
Browse files
src/routes/api/generate/utils.ts
CHANGED
|
@@ -2,10 +2,12 @@ const DEBUG_LOG = true;
|
|
| 2 |
|
| 3 |
export const debugLog = (...args: unknown[]) => {
|
| 4 |
if (!DEBUG_LOG) return;
|
| 5 |
-
|
|
|
|
| 6 |
};
|
| 7 |
|
| 8 |
export const debugError = (...args: unknown[]) => {
|
| 9 |
if (!DEBUG_LOG) return;
|
| 10 |
-
|
|
|
|
| 11 |
};
|
|
|
|
| 2 |
|
| 3 |
export const debugLog = (...args: unknown[]) => {
|
| 4 |
if (!DEBUG_LOG) return;
|
| 5 |
+
const now = new Date();
|
| 6 |
+
console.log(`[Time: ${now.toLocaleTimeString()}] [LOG] ${args.join(" ")}`);
|
| 7 |
};
|
| 8 |
|
| 9 |
export const debugError = (...args: unknown[]) => {
|
| 10 |
if (!DEBUG_LOG) return;
|
| 11 |
+
const now = new Date();
|
| 12 |
+
console.error(`[Time: ${now.toLocaleTimeString()}] [ERROR] ${args.join(" ")}`);
|
| 13 |
};
|