diff options
author | Sebastian <sebasjm@gmail.com> | 2023-01-19 17:05:34 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2023-01-19 17:05:34 -0300 |
commit | 346056ca91d5d91fa3392217c24e8d1e32c91c54 (patch) | |
tree | 96496ed54196e86cb1baa6f1a94442679df806d8 /packages/taler-wallet-webextension/src/wxBackend.ts | |
parent | 40279ae7f0520b25f5aecf5b2318a1bb5772c10c (diff) | |
download | wallet-core-346056ca91d5d91fa3392217c24e8d1e32c91c54.tar.xz |
feat: adjust log level from developer page
Diffstat (limited to 'packages/taler-wallet-webextension/src/wxBackend.ts')
-rw-r--r-- | packages/taler-wallet-webextension/src/wxBackend.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts index c7b964c28..1bfee1064 100644 --- a/packages/taler-wallet-webextension/src/wxBackend.ts +++ b/packages/taler-wallet-webextension/src/wxBackend.ts @@ -26,6 +26,9 @@ import { classifyTalerUri, Logger, + LogLevel, + setGlobalLogLevelFromString, + setLogLevelFromString, TalerErrorCode, TalerUriType, WalletDiagnostics, @@ -180,8 +183,18 @@ const backendHandlers: BackendHandlerType = { resetDb, runGarbageCollector, toggleHeaderListener, + setLoggingLevel, }; +async function setLoggingLevel({ tag, level }: { tag?: string, level: LogLevel }): Promise<void> { + logger.info(`setting ${tag} to ${level}`) + if (!tag) { + setGlobalLogLevelFromString(level) + } else { + setLogLevelFromString(tag, level) + } +} + async function dispatch<Op extends WalletOperations | BackgroundOperations>( req: MessageFromFrontend<Op> & { id: string }, ): Promise<MessageResponse> { |