better logging

This commit is contained in:
2026-04-02 12:07:39 -05:00
parent 0b738ba530
commit 6e45ce6cf9
2 changed files with 17 additions and 11 deletions

View File

@@ -2,6 +2,14 @@
* Quote & Invoice System - Main Entry Point
* Modularized Backend
*/
// ── Global timestamp logger must be first line before any require ──
const _ts = () => new Date().toISOString().replace('T', ' ').substring(0, 19);
const _origLog = console.log.bind(console);
const _origWarn = console.warn.bind(console);
const _origError = console.error.bind(console);
console.log = (...a) => _origLog(`[${_ts()}]`, ...a);
console.warn = (...a) => _origWarn(`[${_ts()}]`, ...a);
console.error = (...a) => _origError(`[${_ts()}]`, ...a);
const express = require('express');
const path = require('path');
const puppeteer = require('puppeteer');