Only show _log_ output if the user passes --debug

If the user doesn't pass `--debug`, we only show `INFO` logs but
without time and level to make it clearer that it is meant to be
read by the user.

Without `--debug`, the user sees:

 Still got 0.00009235 BTC left in wallet, swapping ...

With `--debug`, they see:

2021-03-01 12:21:07  DEBUG Database and seed will be stored in /home/thomas/.local/share/xmr-btc-swap
2021-03-01 12:21:07  DEBUG Starting monero-wallet-rpc on port 40779
2021-03-01 12:21:11   INFO Still got 0.00009235 BTC left in wallet, swapping ...
2021-03-01 12:21:11  DEBUG Dialing alice at 12D3KooWCdMKjesXMJz1SiZ7HgotrxuqhQJbP5sgBm2BwP1cqThi
2021-03-01 12:21:12  DEBUG Requesting quote for 0.00008795 BTC
This commit is contained in:
Thomas Eizinger 2021-03-01 12:19:05 +11:00
parent cb4e2c041b
commit 8c0df23647
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96
2 changed files with 33 additions and 17 deletions

View file

@ -14,6 +14,9 @@ pub struct Arguments {
)]
pub config: Option<PathBuf>,
#[structopt(long, help = "Activate debug logging.")]
pub debug: bool,
#[structopt(subcommand)]
pub cmd: Option<Command>,
}