cleanup events + limits + more logs

This commit is contained in:
Theo Browne
2026-02-22 16:23:46 -08:00
parent 43003a5b01
commit c01f3ff076
4 changed files with 90 additions and 23 deletions

View File

@@ -106,9 +106,16 @@ export function log(
const ts = new Date().toISOString();
let line = `[${ts}] ${level} [${category}] ${message}`;
if (data) {
line += "\n " + JSON.stringify(data, null, 2).replace(/\n/g, "\n ");
line += " " + JSON.stringify(data);
}
appendFileSync(LOG_FILE, line + "\n");
if (level === "ERROR") {
console.error(line);
} else if (level === "WARN") {
console.warn(line);
} else {
console.log(line);
}
}
// ── Helpers ─────────────────────────────────────────────────────────────────