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")}] `);
|
||||
}
|
||||
|
||||
public log(text: any, args?: any): void {
|
||||
public log(text?: any, args?: any): void {
|
||||
args
|
||||
? console.log(this._main + text, args)
|
||||
: console.log(this._main + text);
|
||||
}
|
||||
|
||||
public warn(text: any, args?: any): void {
|
||||
public warn(text?: any, args?: any): void {
|
||||
args
|
||||
? console.warn(this._main + this._wrn + text, args)
|
||||
: console.warn(this._main + this._wrn + text);
|
||||
}
|
||||
|
||||
public error(text: any, args?: any): void {
|
||||
public error(text?: any, args?: any): void {
|
||||
args
|
||||
? console.error(this._main + this._err + text, args)
|
||||
: console.error(this._main + this._err + text);
|
||||
|
|
Loading…
Reference in a new issue