2022-08-29 14:27:47 -04:00
|
|
|
export default class Logger {
|
|
|
|
constructor(public name: string, public color: string) { }
|
|
|
|
|
2022-08-31 16:08:05 -04:00
|
|
|
private _log(level: "log" | "error" | "warn" | "info" | "debug", levelColor: string, args: any[]) {
|
|
|
|
console[level](
|
|
|
|
`%c Vencord %c %c ${this.name} `,
|
|
|
|
`background: ${levelColor}; color: black; font-weight: bold; border-radius: 5px;`,
|
|
|
|
"",
|
|
|
|
`background: ${this.color}; color: black; font-weight: bold; border-radius: 5px;`
|
|
|
|
, ...args
|
|
|
|
);
|
2022-08-29 14:27:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public log(...args: any[]) {
|
2022-08-31 16:08:05 -04:00
|
|
|
this._log("log", "#a6d189", args);
|
2022-08-29 14:27:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public info(...args: any[]) {
|
2022-08-31 16:08:05 -04:00
|
|
|
this._log("info", "#a6d189", args);
|
2022-08-29 14:27:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public error(...args: any[]) {
|
2022-08-31 16:08:05 -04:00
|
|
|
this._log("error", "#e78284", args);
|
2022-08-29 14:27:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public warn(...args: any[]) {
|
2022-08-31 16:08:05 -04:00
|
|
|
this._log("warn", "#e5c890", args);
|
2022-08-29 14:27:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public debug(...args: any[]) {
|
2022-08-31 16:08:05 -04:00
|
|
|
this._log("debug", "#eebebe", args);
|
2022-08-29 14:27:47 -04:00
|
|
|
}
|
2022-09-16 16:59:34 -04:00
|
|
|
}
|