From e6fbad5b84f6f900e92481646419f2498dd3e911 Mon Sep 17 00:00:00 2001 From: Ning Liu Date: Wed, 3 Apr 2024 10:31:24 +0800 Subject: [PATCH] refactor: add debug log --- .../src/component/driver/teamsApp/clients/appStudioClient.ts | 4 +++- .../src/component/driver/teamsApp/publishAppPackage.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/fx-core/src/component/driver/teamsApp/clients/appStudioClient.ts b/packages/fx-core/src/component/driver/teamsApp/clients/appStudioClient.ts index 0bce33a7b3..9c4e3928e9 100644 --- a/packages/fx-core/src/component/driver/teamsApp/clients/appStudioClient.ts +++ b/packages/fx-core/src/component/driver/teamsApp/clients/appStudioClient.ts @@ -367,7 +367,8 @@ export namespace AppStudioClient { export async function publishTeamsAppUpdate( teamsAppId: string, file: Buffer, - appStudioToken: string + appStudioToken: string, + logProvider?: LogProvider ): Promise { setErrorContext({ source: "Teams" }); try { @@ -395,6 +396,7 @@ export namespace AppStudioClient { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions const requestPath = `${response.request?.method} ${response.request?.path}`; + logProvider?.debug(`The response of ${requestPath} is ${JSON.stringify(response)}`); if (response && response.data) { if (response.data.error || response.data.errorMessage) { const error = new Error(response.data.error?.message || response.data.errorMessage); diff --git a/packages/fx-core/src/component/driver/teamsApp/publishAppPackage.ts b/packages/fx-core/src/component/driver/teamsApp/publishAppPackage.ts index 297215d9b1..5f829cd2be 100644 --- a/packages/fx-core/src/component/driver/teamsApp/publishAppPackage.ts +++ b/packages/fx-core/src/component/driver/teamsApp/publishAppPackage.ts @@ -135,7 +135,8 @@ export class PublishAppPackageDriver implements StepDriver { const appId = await AppStudioClient.publishTeamsAppUpdate( manifest.id, archivedFile, - appStudioTokenRes.value + appStudioTokenRes.value, + context.logProvider ); result = new Map([[outputEnvVarNames.get("publishedAppId") as string, appId]]); merge(context.telemetryProperties, {