Make text optional in logger
This commit is contained in:
parent
35f5d3d071
commit
0aea8e7464
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue