diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wxApi.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/wxApi.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/wxApi.ts b/packages/taler-wallet-webextension/src/wxApi.ts index 58ca48745..001f77934 100644 --- a/packages/taler-wallet-webextension/src/wxApi.ts +++ b/packages/taler-wallet-webextension/src/wxApi.ts @@ -25,6 +25,7 @@ import { AbsoluteTime, CoreApiResponse, Logger, + LogLevel, NotificationType, TalerErrorCode, TalerErrorDetail, @@ -85,6 +86,13 @@ export interface BackgroundOperations { request: void; response: void; }; + setLoggingLevel: { + request: { + tag?: string, + level: LogLevel + }; + response: void; + }; } export interface BackgroundApiClient { @@ -122,7 +130,6 @@ class BackgroundApiClientImpl implements BackgroundApiClient { try { response = await platform.sendMessageToBackground(message); } catch (error) { - console.log("Error calling backend"); if (error instanceof Error) { throw new BackgroundError(operation, { code: TalerErrorCode.GENERIC_UNEXPECTED_REQUEST_ERROR, @@ -131,13 +138,13 @@ class BackgroundApiClientImpl implements BackgroundApiClient { } throw error; } - logger.info("got response", response); if (response.type === "error") { throw new BackgroundError( `Background operation "${operation}" failed`, response.error, ); } + logger.trace("response", response); return response.result as any; } } @@ -162,13 +169,13 @@ class WalletApiClientImpl implements WalletCoreApiClient { console.log("Error calling backend"); throw new Error(`Error contacting backend: ${e}`); } - logger.info("got response", response); if (response.type === "error") { throw new BackgroundError( `Wallet operation "${operation}" failed`, response.error, ); } + logger.trace("got response", response); return response.result as any; } } |