diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/wallet')
-rw-r--r-- | packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx index 3df3a470c..ee0986076 100644 --- a/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx +++ b/packages/taler-wallet-webextension/src/wallet/DeveloperPage.tsx @@ -19,6 +19,7 @@ import { CoinDumpJson, CoinStatus, ExchangeListItem, + LogLevel, NotificationType, } from "@gnu-taler/taler-util"; import { @@ -29,6 +30,7 @@ import { format } from "date-fns"; import { Fragment, h, VNode } from "preact"; import { useEffect, useRef, useState } from "preact/hooks"; import { Diagnostics } from "../components/Diagnostics.js"; +import { SelectList } from "../components/SelectList.js"; import { NotifyUpdateFadeOut } from "../components/styled/index.js"; import { Time } from "../components/Time.js"; import { useBackendContext } from "../context/backend.js"; @@ -37,6 +39,8 @@ import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; import { useDiagnostics } from "../hooks/useDiagnostics.js"; import { Button } from "../mui/Button.js"; import { Grid } from "../mui/Grid.js"; +import { Paper } from "../mui/Paper.js"; +import { TextField } from "../mui/TextField.js"; export function DeveloperPage(): VNode { const [status, timedOut] = useDiagnostics(); @@ -167,6 +171,9 @@ export function View({ [exchange_name: string]: CalculatedCoinfInfo[]; }, ); + + const [tagName, setTagName] = useState(""); + const [logLevel, setLogLevel] = useState("info"); return ( <div> <p> @@ -312,6 +319,42 @@ export function View({ </Button> </Grid>{" "} </Grid> + <Paper style={{ padding: 10, margin: 10 }}> + <h3>Logging</h3> + <div> + <TextField + label="Tag name" + placeholder="wallet.ts" + variant="filled" + // error={subject.error} + required + value={tagName} + onChange={setTagName} + /> + <SelectList + label={i18n.str`Log levels`} + list={{ + trace: "TRACE", + info: "INFO", + error: "ERROR", + }} + name="logLevel" + value={logLevel} + onChange={(v) => setLogLevel(v)} + /> + </div> + <Button + variant="contained" + onClick={async () => { + api.background.call("setLoggingLevel", { + tag: tagName, + level: logLevel as LogLevel, + }); + }} + > + Set log level + </Button> + </Paper> {downloadedDatabase && ( <div> <i18n.Translate> |