connection working

This commit is contained in:
nora 2022-02-19 18:12:28 +01:00
parent ca1f372665
commit 13deef42fd
9 changed files with 217 additions and 82 deletions

View file

@ -1,18 +1,28 @@
use anyhow::Result;
use std::env;
use tracing::Level;
#[tokio::main]
async fn main() -> Result<()> {
setup_tracing();
let mut level = Level::DEBUG;
for arg in env::args().skip(1) {
match arg.as_str() {
"--trace" => level = Level::TRACE,
_ => {}
}
}
setup_tracing(level);
amqp_transport::do_thing_i_guess().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_max_level(Level::DEBUG)
.with_max_level(level)
.init()
}