Updated logger function
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user