This commit is contained in:
Benjamin Toby
2025-07-05 14:59:30 +01:00
parent 6e334c2525
commit 7e8bb37c09
526 changed files with 17560 additions and 11386 deletions
+9 -12
View File
@@ -1,20 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = debugLog;
const console_colors_1 = require("../console-colors");
import { ccol } from "../console-colors";
const LogTypes = ["error", "warning"];
function debugLog({ log, label, title, type, addTime }) {
export default function debugLog({ log, label, title, type, addTime }) {
const logType = (() => {
switch (type) {
case "error":
return console_colors_1.ccol.FgRed;
return ccol.FgRed;
case "warning":
return console_colors_1.ccol.FgYellow;
return ccol.FgYellow;
default:
return console_colors_1.ccol.FgGreen;
return ccol.FgGreen;
}
})();
let logTxt = `${logType}DEBUG${console_colors_1.ccol.Reset}:::`;
let logTxt = `${logType}DEBUG${ccol.Reset}:::`;
const date = new Date();
const time = date.toLocaleTimeString("en-US", {
hour: "numeric",
@@ -24,10 +21,10 @@ function debugLog({ log, label, title, type, addTime }) {
});
const logTime = `${date.toLocaleDateString()}][${time}`;
if (addTime)
logTxt = `${console_colors_1.ccol.BgWhite}[${logTime}]${console_colors_1.ccol.Reset} ` + logTxt;
logTxt = `${ccol.BgWhite}[${logTime}]${ccol.Reset} ` + logTxt;
if (title)
logTxt += `${console_colors_1.ccol.FgBlue}${title}${console_colors_1.ccol.Reset}::`;
logTxt += `${ccol.FgBlue}${title}${ccol.Reset}::`;
if (label)
logTxt += `${console_colors_1.ccol.FgWhite}${console_colors_1.ccol.Bright}${label}${console_colors_1.ccol.Reset} =>`;
logTxt += `${ccol.FgWhite}${ccol.Bright}${label}${ccol.Reset} =>`;
console.log(logTxt, log);
}