Make text optional in logger

This commit is contained in:
powermaker450 2024-08-21 11:32:30 -04:00
parent 35f5d3d071
commit 0aea8e7464

View file

@ -12,19 +12,19 @@ export class Logger {
this._main = chalk.bold.gray(`[SRS | ${emp(origin ?? "Anonymous")}] `); this._main = chalk.bold.gray(`[SRS | ${emp(origin ?? "Anonymous")}] `);
} }
public log(text: any, args?: any): void { public log(text?: any, args?: any): void {
args args
? console.log(this._main + text, args) ? console.log(this._main + text, args)
: console.log(this._main + text); : console.log(this._main + text);
} }
public warn(text: any, args?: any): void { public warn(text?: any, args?: any): void {
args args
? console.warn(this._main + this._wrn + text, args) ? console.warn(this._main + this._wrn + text, args)
: console.warn(this._main + this._wrn + text); : console.warn(this._main + this._wrn + text);
} }
public error(text: any, args?: any): void { public error(text?: any, args?: any): void {
args args
? console.error(this._main + this._err + text, args) ? console.error(this._main + this._err + text, args)
: console.error(this._main + this._err + text); : console.error(this._main + this._err + text);