add proper command line options and logging
This commit is contained in:
@ -12,5 +12,7 @@ tonic = "0.8"
|
||||
tokio = {version = "1", features = ["full"]}
|
||||
tokio-stream = { version = "0.1.11", features = ["net"] }
|
||||
|
||||
tracing-subscriber = { version = "0.3.16", features = ["json"] }
|
||||
tracing = { version = "0.1.37", features = ["log"] }
|
||||
|
||||
libvanity = {path = "../libvanity"}
|
||||
|
@ -1,3 +1,5 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use clap::Parser;
|
||||
use libvanity::vanity::VanityRequest;
|
||||
|
||||
@ -11,12 +13,20 @@ struct Args {
|
||||
|
||||
#[clap(help = "pattern of public key")]
|
||||
pattern: String,
|
||||
|
||||
#[clap(short, long, default_value = "WARN")]
|
||||
log_level: String,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let args = Args::parse();
|
||||
|
||||
let level = tracing::Level::from_str(&args.log_level)?;
|
||||
tracing_subscriber::FmtSubscriber::builder()
|
||||
.with_max_level(level)
|
||||
.init();
|
||||
|
||||
let mut client =
|
||||
libvanity::vanity::vanity_service_client::VanityServiceClient::connect(args.endpoint)
|
||||
.await?;
|
||||
|
Reference in New Issue
Block a user