check for undefined, no need for !

This commit is contained in:
Bruno Windels 2021-11-17 12:39:57 +01:00
parent b1d20178f8
commit 276d8d4a42

View file

@ -61,11 +61,11 @@ export abstract class BaseLogger implements ILogger {
Errors and duration are transparently logged, also for async operations. Errors and duration are transparently logged, also for async operations.
Whatever the callback returns is returned here. */ Whatever the callback returns is returned here. */
run<T>(labelOrValues: LabelOrValues, callback: LogCallback<T>, logLevel?: LogLevel, filterCreator?: FilterCreator): T { run<T>(labelOrValues: LabelOrValues, callback: LogCallback<T>, logLevel?: LogLevel, filterCreator?: FilterCreator): T {
if (!logLevel) { if (logLevel === undefined) {
logLevel = LogLevel.Info; logLevel = LogLevel.Info;
} }
const item = new LogItem(labelOrValues, logLevel, this); const item = new LogItem(labelOrValues, logLevel, this);
return this._run(item, callback, logLevel!, true, filterCreator); return this._run(item, callback, logLevel, true, filterCreator);
} }
_run<T>(item: ILogItem, callback: LogCallback<T>, logLevel: LogLevel, wantResult: true, filterCreator?: FilterCreator): T; _run<T>(item: ILogItem, callback: LogCallback<T>, logLevel: LogLevel, wantResult: true, filterCreator?: FilterCreator): T;