More progress
This commit is contained in:
parent
1709ab61ef
commit
c39ff8f648
15 changed files with 296 additions and 155 deletions
27
src/utils/logger.ts
Normal file
27
src/utils/logger.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
export default class Logger {
|
||||
constructor(public name: string, public color: string) { }
|
||||
|
||||
private _log(level: "log" | "error" | "warn" | "info" | "debug", args: any[]) {
|
||||
console[level](`%c ${this.name} `, `background: ${this.color}; color: black; font-weight: bold`, ...args);
|
||||
}
|
||||
|
||||
public log(...args: any[]) {
|
||||
this._log("log", args);
|
||||
}
|
||||
|
||||
public info(...args: any[]) {
|
||||
this._log("info", args);
|
||||
}
|
||||
|
||||
public error(...args: any[]) {
|
||||
this._log("error", args);
|
||||
}
|
||||
|
||||
public warn(...args: any[]) {
|
||||
this._log("warn", args);
|
||||
}
|
||||
|
||||
public debug(...args: any[]) {
|
||||
this._log("debug", args);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue