Make perfLogger potentially undefined rather than using a noop logger (#53229)

This commit is contained in:
Jake Bailey
2023-03-15 15:58:26 -07:00
committed by GitHub
parent 63495beb1a
commit a727ca1571
10 changed files with 30 additions and 54 deletions

View File

@@ -259,13 +259,13 @@ export function initializeNodeSystem(): StartInput {
msg(s: string, type: Msg = Msg.Err) {
switch (type) {
case Msg.Info:
perfLogger.logInfoEvent(s);
perfLogger?.logInfoEvent(s);
break;
case Msg.Perf:
perfLogger.logPerfEvent(s);
perfLogger?.logPerfEvent(s);
break;
default: // Msg.Err
perfLogger.logErrEvent(s);
perfLogger?.logErrEvent(s);
break;
}