From 70fcd186909c589a71188155eca9b7aca28e0f49 Mon Sep 17 00:00:00 2001 From: Sam Sartor Date: Mon, 11 Nov 2024 14:09:05 -0700 Subject: [PATCH] actually make logging work --- gui/Cargo.toml | 2 +- gui/src/lib.rs | 13 +++++++------ gui/src/main.rs | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gui/Cargo.toml b/gui/Cargo.toml index 333a923..55f118c 100644 --- a/gui/Cargo.toml +++ b/gui/Cargo.toml @@ -83,7 +83,7 @@ futures-channel = "0.3.30" sir = { git = "https://gitlab.com/samsartor/sir", features = ["dioxus"] } # dioxus 0.6 mumble-web2-common = { workspace = true } serde = { workspace = true } -tracing-subscriber = { version = "0.3.18", default-features = false, features = ["ansi"] } +tracing-subscriber = { version = "0.3.18", features = ["ansi"] } tracing = "0.1.40" color-eyre = "0.6.3" diff --git a/gui/src/lib.rs b/gui/src/lib.rs index 8ac3777..1798681 100644 --- a/gui/src/lib.rs +++ b/gui/src/lib.rs @@ -25,6 +25,7 @@ use std::collections::HashMap; use std::time::Duration; use tracing::debug; use tracing::error; +use tracing::info; pub mod app; pub mod imp; @@ -58,10 +59,10 @@ pub async fn network_loop( spawn(async move { while let Some(msg) = writer_recv_chan.next().await { if !matches!(msg, ControlPacket::Ping(_) | ControlPacket::UDPTunnel(_)) { - debug!("sending {:#?}", msg); + info!("sending packet {:#?}", msg); } if let Err(e) = writer.send(msg).await { - error!("error sending message {:?}", e); + error!("error sending packet {:?}", e); break; } } @@ -73,7 +74,7 @@ pub async fn network_loop( Some(Err(err)) => bail!("bad version packet: {err:?}"), None => bail!("no version was recieved"), }; - debug!("got version packet {:#?}", version); + info!("got version packet {:#?}", version); // Send version packet let mut msg = msgs::Version::new(); @@ -117,7 +118,7 @@ pub async fn network_loop( match packet { Some(Ok(msg)) => { if !matches!(msg, ControlPacket::UDPTunnel(_) | ControlPacket::Ping(_)) { - debug!("receiving {:#?}", msg); + info!("receiving packet {:#?}", msg); } let res = accept_packet(msg, &mut audio, &mut decoder_map); if let Err(err) = res { @@ -133,14 +134,14 @@ pub async fn network_loop( command = command_future => { command_future = event_rx.next(); if let Some(command) = &command { - debug!("commanding {:#?}", command); + info!("issuing command {:#?}", command); } match command { Some(Command::Disconnect) => break, Some(command) => { let res = accept_command(command, &mut send_chan); if let Err(err) = res { - error!("error accepting command {:?}", err) + info!("error accepting command {:?}", err) } } None => continue, diff --git a/gui/src/main.rs b/gui/src/main.rs index 07e30e7..f384bf5 100644 --- a/gui/src/main.rs +++ b/gui/src/main.rs @@ -1,4 +1,4 @@ -use mumble_web2_gui::app; +use mumble_web2_gui::{app, imp::init_logging}; pub fn main() { #[cfg(feature = "desktop")] @@ -7,5 +7,6 @@ pub fn main() { .build() .unwrap() .enter(); + init_logging(); dioxus::launch(app::app); }