diff --git a/src/client/deprecatedProposedApi.ts b/src/client/deprecatedProposedApi.ts index c178c1f9f0a7..459f2b1bf529 100644 --- a/src/client/deprecatedProposedApi.ts +++ b/src/client/deprecatedProposedApi.ts @@ -63,10 +63,8 @@ export function buildDeprecatedProposedApi( const interpreterPathService = serviceContainer.get(IInterpreterPathService); const interpreterService = serviceContainer.get(IInterpreterService); const extensions = serviceContainer.get(IExtensions); + const warningLogged = new Set(); function sendApiTelemetry(apiName: string, warnLog = true) { - if (warnLog) { - console.warn('Extension is using deprecated python APIs which will be removed soon'); - } extensions .determineExtensionFromCallStack() .then((info) => { @@ -75,6 +73,12 @@ export function buildDeprecatedProposedApi( extensionId: info.extensionId, }); traceVerbose(`Extension ${info.extensionId} accessed ${apiName}`); + if (warnLog && !warningLogged.has(info.extensionId)) { + console.warn( + `${info.extensionId} extension is using deprecated python APIs which will be removed soon.`, + ); + warningLogged.add(info.extensionId); + } }) .ignoreErrors(); }