diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-08-18 23:06:27 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-08-18 23:06:27 +0200 |
commit | d4021a9d17c23a897850be275397cdfc71ee4523 (patch) | |
tree | 268c05d4438c52cddfa4af770eb0f97914a55315 /src/headless | |
parent | 23e72ce25cb5f7eede60281b499f527554db2185 (diff) |
slightly more sane logging
Diffstat (limited to 'src/headless')
-rw-r--r-- | src/headless/helpers.ts | 2 | ||||
-rw-r--r-- | src/headless/taler-wallet-cli.ts | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/headless/helpers.ts b/src/headless/helpers.ts index 0a98f7ce8..975c45e52 100644 --- a/src/headless/helpers.ts +++ b/src/headless/helpers.ts @@ -173,8 +173,6 @@ export async function getDefaultNodeWallet( shimIndexedDB(myBridgeIdbFactory); - console.log("opening taler DB"); - const myDb = await openTalerDb( myIdbFactory, myVersionChange, diff --git a/src/headless/taler-wallet-cli.ts b/src/headless/taler-wallet-cli.ts index 6e2190236..0f40c4734 100644 --- a/src/headless/taler-wallet-cli.ts +++ b/src/headless/taler-wallet-cli.ts @@ -19,16 +19,27 @@ import os = require("os"); import { getDefaultNodeWallet, withdrawTestBalance } from "./helpers"; import { MerchantBackendConnection } from "./merchant"; import { runIntegrationTest } from "./integrationtest"; +import { Wallet } from "../wallet"; const program = new commander.Command(); -program.version("0.0.1"); +program + .version("0.0.1") + .option('--verbose', "enable verbose output", false); const walletDbPath = os.homedir + "/" + ".talerwalletdb.json"; +function applyVerbose(verbose: boolean) { + if (verbose) { + console.log("enabled verbose logging"); + Wallet.enableTracing = true; + } +} + program .command("test-withdraw") .description("withdraw test currency from the test bank") .action(async () => { + applyVerbose(program.verbose) console.log("test-withdraw command called"); const wallet = await getDefaultNodeWallet({ persistentStoragePath: walletDbPath, @@ -41,6 +52,7 @@ program .command("balance") .description("show wallet balance") .action(async () => { + applyVerbose(program.verbose) console.log("balance command called"); const wallet = await getDefaultNodeWallet({ persistentStoragePath: walletDbPath, @@ -63,6 +75,7 @@ program .option('-s, --spend-amount <spend-amt>', 'amount to spend', "TESTKUDOS:5") .description("Run integration test with bank, exchange and merchant.") .action(async (cmdObj) => { + applyVerbose(program.verbose) await runIntegrationTest({ amountToSpend: cmdObj.spendAmount, |