Updated logger function

This commit is contained in:
2025-01-12 19:54:07 +01:00
parent 560ad899f8
commit f2d45bacfd

View File

@@ -11,10 +11,11 @@ const colors = {
type Colors = keyof typeof colors
const AllLogs = {
info: { m: "INFO", c: null },
error: { m: "ERROR", c: "#ff6666" },
warn: { m: "WARN", c: "#ffcc99" },
debug: { m: "DEBUG", c: "#66ff66" }
info: { m: "INFO", c: "#a6e3a1" },
warn: { m: "WARN", c: "#fab387" },
error: { m: "ERROR", c: "#f38ba8" },
critical: { m: "CRITICAL", c: "#ff3d3d" },
debug: { m: "DEBUG", c: "#f9e2af" }
} as const
type LogType = keyof typeof AllLogs
@@ -35,11 +36,7 @@ export function log(m: string, t: LogType, c?: CustomColorProps): void {
const message = `${time} - [${logType}] | ${m}`
if (!c) {
if (t === "info") {
console.log(message)
return
}
console.log(cc(message, logColor!))
console.log(cc(message, logColor))
return
}