Add verbose request logging feature to wallet (#758)

* Add verbose request logging feature to wallet

* add verbose cli tests

---------

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
Olindo Task
2025-06-24 14:31:40 -06:00
committed by GitHub
parent 48823d673d
commit bbfb63b34e
5 changed files with 78 additions and 2 deletions

View File

@@ -148,9 +148,16 @@ def init_auth_wallet(func):
default=False,
help="Run in test mode (don't ask for CLI inputs)",
)
@click.option(
"--verbose",
"-v",
is_flag=True,
default=False,
help="Enable verbose mode to show all requests to the mint",
)
@click.pass_context
@coro
async def cli(ctx: Context, host: str, walletname: str, unit: str, tests: bool):
async def cli(ctx: Context, host: str, walletname: str, unit: str, tests: bool, verbose: bool):
if settings.debug:
configure_logger()
if settings.tor and not TorProxy().check_platform():
@@ -184,6 +191,8 @@ async def cli(ctx: Context, host: str, walletname: str, unit: str, tests: bool):
unit = ctx.obj["UNIT"]
ctx.obj["WALLET_NAME"] = walletname
settings.wallet_name = walletname
settings.wallet_verbose_requests = verbose
ctx.obj["VERBOSE"] = verbose
db_path = os.path.join(settings.cashu_dir, walletname)
# if the command is "restore" we don't want to ask the user for a mnemonic