Added static events to the emitter & added it to the logger
This commit is contained in:
@ -68,35 +68,35 @@ export class Logger extends TypedEmitter<LoggerEvents> {
|
||||
|
||||
debug(...args: string[]) {
|
||||
if(LOG_LEVEL.VERBOSE >= Logger.LOG_LEVEL) {
|
||||
this.emit('VERBOSE', ...args);
|
||||
Logger.emit(LOG_LEVEL.VERBOSE, ...args);
|
||||
console.debug(CliForeground.LIGHT_GREY + this.format(...args) + CliEffects.CLEAR);
|
||||
}
|
||||
}
|
||||
|
||||
error(...args: string[]) {
|
||||
if(LOG_LEVEL.ERROR >= Logger.LOG_LEVEL) {
|
||||
this.emit('ERROR', ...args);
|
||||
Logger.emit(LOG_LEVEL.ERROR, ...args);
|
||||
console.error(CliForeground.RED + this.format(...args) + CliEffects.CLEAR);
|
||||
}
|
||||
}
|
||||
|
||||
info(...args: string[]) {
|
||||
if(LOG_LEVEL.INFO >= Logger.LOG_LEVEL) {
|
||||
this.emit('INFO', ...args);
|
||||
Logger.emit(LOG_LEVEL.INFO, ...args);
|
||||
console.info(CliForeground.CYAN + this.format(...args) + CliEffects.CLEAR);
|
||||
}
|
||||
}
|
||||
|
||||
log(...args: string[]) {
|
||||
if(LOG_LEVEL.INFO >= Logger.LOG_LEVEL) {
|
||||
this.emit('INFO', ...args);
|
||||
Logger.emit(LOG_LEVEL.INFO, ...args);
|
||||
console.log(CliEffects.CLEAR + this.format(...args));
|
||||
}
|
||||
}
|
||||
|
||||
warn(...args: string[]) {
|
||||
if(LOG_LEVEL.WARN >= Logger.LOG_LEVEL) {
|
||||
this.emit('WARN', ...args);
|
||||
Logger.emit(LOG_LEVEL.WARN, ...args);
|
||||
console.warn(CliForeground.YELLOW + this.format(...args) + CliEffects.CLEAR);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user