Skip to content

Commit

Permalink
fix: remove need of setting RUST_LOG environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hdvanegasm committed Oct 29, 2024
1 parent 230cb18 commit 2f68255
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ struct Args {
}

fn main() -> Result<(), Box<dyn Error>> {
env_logger::init();
let mut log_builder = env_logger::Builder::new();
log_builder.filter_level(log::LevelFilter::Info).init();

let args = Args::parse();

// Create the network for communication.
Expand Down
3 changes: 2 additions & 1 deletion src/net/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl Channel for TcpChannel {
stream.shutdown(std::net::Shutdown::Both)?;
}
self.stream = None;
log::info!("channel successfully created");
log::info!("channel successfully closed");
Ok(())
}

Expand Down Expand Up @@ -184,6 +184,7 @@ pub struct LoopBackChannel {
impl Channel for LoopBackChannel {
fn close(&mut self) -> anyhow::Result<()> {
self.buffer.clear();
log::info!("channel successfully closed");
Ok(())
}

Expand Down

0 comments on commit 2f68255

Please sign in to comment.