Something went wrong. Try again.
Mirroring: https://github.com/MunifTanjim/scripts.sh
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930export class Logger { #typeMap = { "": " ", error: chalk.red("error"), info: chalk.blue(" info"), input: chalk.magenta("input"), warn: chalk.yellow(" warn"), };
constructor(service) { this.service = service; }
fmt = (type, message) => { const string = [this.service, this.#typeMap[type], message] .filter(Boolean) .join(" "); return string; };
#log = (type, message, ...args) => { console.log(this.fmt(type, message), ...args); };
error = (message, ...args) => this.#log("error", message, ...args); info = (message, ...args) => this.#log("info", message, ...args); log = (message, ...args) => this.#log("", message, ...args); warn = (message, ...args) => this.#log("warn", message, ...args);}