Add even more MSAL error telemetry (#246335)

This commit is contained in:
Tyler James Leonhardt
2025-04-11 10:42:41 -07:00
committed by GitHub
parent 1b1ed33f82
commit febbcf78c8
4 changed files with 18 additions and 7 deletions

View File

@@ -5,11 +5,15 @@
import { LogLevel as MsalLogLevel } from '@azure/msal-node';
import { env, LogLevel, LogOutputChannel } from 'vscode';
import { MicrosoftAuthenticationTelemetryReporter } from './telemetryReporter';
export class MsalLoggerOptions {
piiLoggingEnabled = false;
constructor(private readonly _output: LogOutputChannel) { }
constructor(
private readonly _output: LogOutputChannel,
private readonly _telemtryReporter: MicrosoftAuthenticationTelemetryReporter
) { }
get logLevel(): MsalLogLevel {
return this._toMsalLogLevel(env.logLevel);
@@ -27,6 +31,7 @@ export class MsalLoggerOptions {
switch (level) {
case MsalLogLevel.Error:
this._output.error(message);
this._telemtryReporter.sendTelemetryErrorEvent(message);
return;
case MsalLogLevel.Warning:
this._output.warn(message);