commit 0c191015e4dac3e0ccc61a2eee47cacb30d6d970
parent 5a4190adc89e7afd25f5099f3c0f458236e35db6
Author: Iván Ávalos <avalos@disroot.org>
Date: Thu, 15 May 2025 16:13:47 +0200
wallet-core: add logLevel to initWallet request
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/packages/taler-util/src/types-taler-wallet.ts b/packages/taler-util/src/types-taler-wallet.ts
@@ -414,6 +414,7 @@ export interface PartialWalletRunConfig {
testing?: Partial<WalletRunConfig["testing"]>;
features?: Partial<WalletRunConfig["features"]>;
lazyTaskLoop?: Partial<WalletRunConfig["lazyTaskLoop"]>;
+ logLevel?: Partial<WalletRunConfig["logLevel"]>;
}
export interface WalletRunConfig {
@@ -454,6 +455,11 @@ export interface WalletRunConfig {
* unrelated pending tasks.
*/
lazyTaskLoop: boolean;
+
+ /**
+ * Global log level.
+ */
+ logLevel: string;
}
export interface InitRequest {
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
@@ -234,6 +234,7 @@ import {
performanceNow,
safeStringifyException,
setDangerousTimetravel,
+ setGlobalLogLevelFromString,
stringifyScopeInfo,
validateIban,
} from "@gnu-taler/taler-util";
@@ -888,6 +889,10 @@ async function handleSetWalletRunConfig(
await fillDefaults(wex);
}
+ if (req.config?.logLevel) {
+ setGlobalLogLevelFromString(req.config.logLevel);
+ }
+
await migrateMaterializedTransactions(wex);
const resp: InitResponse = {
@@ -2527,6 +2532,7 @@ function applyRunConfigDefaults(wcp?: PartialWalletRunConfig): WalletRunConfig {
emitObservabilityEvents: wcp?.testing?.emitObservabilityEvents ?? false,
},
lazyTaskLoop: wcp?.lazyTaskLoop ?? false,
+ logLevel: wcp?.logLevel ?? "INFO",
};
}