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