taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 95261ec6c955b1bdc3aa8e76c04b004e8a2b06e6
parent 72dfb31125aba1dc184f1cac065206fe000ba08f
Author: Florian Dold <florian@dold.me>
Date:   Wed, 30 Oct 2024 20:16:59 +0100

util: remove logging to stdout

Logging to stdout breaks clients, as the wallet CLI writes
machine-readable JSON responses to stdout.  Thus, logging must only
happen via the logger (by default to stderr).

Diffstat:
Mpackages/taler-util/src/bank-api-client.ts | 15+++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/packages/taler-util/src/bank-api-client.ts b/packages/taler-util/src/bank-api-client.ts @@ -23,7 +23,6 @@ */ import { AccountData, - AmountJson, AmountString, base64FromArrayBuffer, buildCodecForObject, @@ -223,8 +222,14 @@ export class TalerCorebankApiClient { return readSuccessResponseJsonOrThrow(resp, codecForAny()); } - async makeTransaction(amount: AmountString, target: PaytoString): Promise<void> { - const reqUrl = new URL(`accounts/${this.args.auth!.username}/transactions`, this.baseUrl); + async makeTransaction( + amount: AmountString, + target: PaytoString, + ): Promise<void> { + const reqUrl = new URL( + `accounts/${this.args.auth!.username}/transactions`, + this.baseUrl, + ); const resp = await this.httpLib.fetch(reqUrl.href, { method: "POST", body: { @@ -233,7 +238,7 @@ export class TalerCorebankApiClient { }, headers: { ...this.makeAuthHeader(), - "Content-Type": "application/json" + "Content-Type": "application/json", }, }); @@ -241,7 +246,6 @@ export class TalerCorebankApiClient { logger.info(`result: ${j2s(res)}`); } - async getTransactions(username: string): Promise<void> { const reqUrl = new URL(`accounts/${username}/transactions`, this.baseUrl); const resp = await this.httpLib.fetch(reqUrl.href, { @@ -288,7 +292,6 @@ export class TalerCorebankApiClient { */ async registerAccount(username: string, password: string): Promise<BankUser> { const url = new URL("accounts", this.baseUrl); - console.log(username, password); const resp = await this.httpLib.fetch(url.href, { method: "POST", body: {