This commit is contained in:
nora 2022-02-20 14:10:19 +01:00
parent 2e0a31f4af
commit ed4a107c44
13 changed files with 1448 additions and 1860 deletions

View file

@ -1,20 +1,25 @@
#![warn(rust_2018_idioms)]
use anyhow::Result;
use std::env;
use tracing::Level;
use tracing::{info_span, Instrument};
#[tokio::main]
async fn main() -> Result<()> {
let mut dashboard = false;
let mut level = Level::INFO;
for arg in env::args().skip(1) {
match arg.as_str() {
"--trace" => level = Level::TRACE,
"--dashboard" => dashboard = true,
"ignore-this-clippy" => eprintln!("yes please"),
_ => {}
}
}
setup_tracing();
setup_tracing(level);
let global_data = amqp_core::GlobalData::default();
@ -26,12 +31,12 @@ async fn main() -> Result<()> {
amqp_transport::do_thing_i_guess(global_data).await
}
fn setup_tracing() {
fn setup_tracing(level: Level) {
tracing_subscriber::fmt()
.with_level(true)
.with_timer(tracing_subscriber::fmt::time::time())
.with_ansi(true)
.with_thread_names(true)
.with_env_filter("hyper=info,debug")
.with_max_level(level)
.init()
}