mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-14 19:55:03 +01:00
cleanup
This commit is contained in:
parent
2e0a31f4af
commit
ed4a107c44
13 changed files with 1448 additions and 1860 deletions
11
src/main.rs
11
src/main.rs
|
|
@ -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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue