import { ccol } from "../console-colors"; const LogTypes = ["error", "warning"]; export default function debugLog({ log, label, title, type, addTime }) { const logType = (() => { switch (type) { case "error": return ccol.FgRed; case "warning": return ccol.FgYellow; default: return ccol.FgGreen; } })(); let logTxt = `${logType}DEBUG${ccol.Reset}:::`; const date = new Date(); const time = date.toLocaleTimeString("en-US", { hour: "numeric", minute: "numeric", second: "numeric", hour12: true, }); const logTime = `${date.toLocaleDateString()}][${time}`; if (addTime) logTxt = `${ccol.BgWhite}[${logTime}]${ccol.Reset} ` + logTxt; if (title) logTxt += `${ccol.FgBlue}${title}${ccol.Reset}::`; if (label) logTxt += `${ccol.FgWhite}${ccol.Bright}${label}${ccol.Reset} =>`; console.log(logTxt, log); }