parent
bac8a648b6
commit
f60ccb766f
@ -1,27 +1,33 @@
|
|||||||
export default class Logger {
|
export default class Logger {
|
||||||
constructor(public name: string, public color: string) { }
|
constructor(public name: string, public color: string) { }
|
||||||
|
|
||||||
private _log(level: "log" | "error" | "warn" | "info" | "debug", args: any[]) {
|
private _log(level: "log" | "error" | "warn" | "info" | "debug", levelColor: string, args: any[]) {
|
||||||
console[level](`%c ${this.name} `, `background: ${this.color}; color: black; font-weight: bold`, ...args);
|
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
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public log(...args: any[]) {
|
public log(...args: any[]) {
|
||||||
this._log("log", args);
|
this._log("log", "#a6d189", args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public info(...args: any[]) {
|
public info(...args: any[]) {
|
||||||
this._log("info", args);
|
this._log("info", "#a6d189", args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public error(...args: any[]) {
|
public error(...args: any[]) {
|
||||||
this._log("error", args);
|
this._log("error", "#e78284", args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public warn(...args: any[]) {
|
public warn(...args: any[]) {
|
||||||
this._log("warn", args);
|
this._log("warn", "#e5c890", args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public debug(...args: any[]) {
|
public debug(...args: any[]) {
|
||||||
this._log("debug", args);
|
this._log("debug", "#eebebe", args);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in new issue