added -t, --trace option to binaries

This commit is contained in:
lunar-mining
2021-12-14 22:34:43 +01:00
parent 973dd67bd0
commit 618ad12c7e
6 changed files with 27 additions and 6 deletions

View File

@@ -6,4 +6,4 @@ wrap_comments = true
binop_separator = "Back"
trailing_comma = "Vertical"
trailing_semicolon = false
use_field_init_shorthand = true
use_field_init_shorthand = true

View File

@@ -736,6 +736,7 @@ async fn main() -> Result<()> {
(@arg CONFIG: -c --config +takes_value "Sets a custom config file")
(@arg ADDRESS: -a --address "Get Cashier Public key")
(@arg verbose: -v --verbose "Increase verbosity")
(@arg trace: -t --trace "Show event trace")
(@arg refresh: -r --refresh "Refresh the wallet and slabstore")
)
.get_matches();
@@ -746,7 +747,13 @@ async fn main() -> Result<()> {
join_config_path(&PathBuf::from("cashierd.toml"))?
};
let loglevel = if args.is_present("verbose") { log::Level::Debug } else { log::Level::Info };
let loglevel = if args.is_present("verbose") {
log::Level::Debug
} else if args.is_present("trace") {
log::Level::Trace
} else {
log::Level::Info
};
simple_logger::init_with_level(loglevel)?;

View File

@@ -617,6 +617,7 @@ async fn main() -> Result<()> {
let args = clap_app!(darkfid =>
(@arg CONFIG: -c --config +takes_value "Sets a custom config file")
(@arg verbose: -v --verbose "Increase verbosity")
(@arg trace: -t --trace "Show event trace")
(@arg refresh: -r --refresh "Refresh the wallet and slabstore")
(@arg cashier: --cashier +takes_value "Local cashier public key")
)
@@ -628,7 +629,13 @@ async fn main() -> Result<()> {
join_config_path(&PathBuf::from("darkfid.toml"))?
};
let loglevel = if args.is_present("verbose") { log::Level::Debug } else { log::Level::Info };
let loglevel = if args.is_present("verbose") {
log::Level::Debug
} else if args.is_present("trace") {
log::Level::Trace
} else {
log::Level::Info
};
simple_logger::init_with_level(loglevel)?;

View File

@@ -287,6 +287,7 @@ async fn main() -> Result<()> {
let args = clap_app!(drk =>
(@arg CONFIG: -c --config +takes_value "Sets a custom config file")
(@arg verbose: -v --verbose "Increase verbosity")
(@arg trace: -t --trace "Show event trace")
(@subcommand hello =>
(about: "Say hello to the RPC")
)
@@ -339,7 +340,13 @@ async fn main() -> Result<()> {
join_config_path(&PathBuf::from("drk.toml"))?
};
let loglevel = if args.is_present("verbose") { log::Level::Debug } else { log::Level::Info };
let loglevel = if args.is_present("verbose") {
log::Level::Debug
} else if args.is_present("trace") {
log::Level::Debug
} else {
log::Level::Info
};
simple_logger::init_with_level(loglevel)?;
let config = Config::<DrkConfig>::load(config_path)?;

View File

@@ -4,7 +4,7 @@ use async_executor::Executor;
use async_std::sync::{Arc, Mutex};
use async_trait::async_trait;
use futures::stream::{FuturesUnordered, StreamExt};
use log::{error, debug};
use log::{debug, error};
use crate::{
crypto::keypair::PublicKey, types::*, util::NetworkName, wallet::cashierdb::TokenKey, Error,

View File

@@ -6,7 +6,7 @@ use async_trait::async_trait;
use hash_db::Hasher;
use keccak_hasher::KeccakHasher;
use lazy_static::lazy_static;
use log::{debug, info, error};
use log::{debug, error, info};
use num_bigint::{BigUint, RandBigInt};
use serde::{Deserialize, Serialize};
use serde_json::{json, Value};