diff --git a/src/component/test.rs b/src/component/test.rs index c6ebfe2..b368742 100644 --- a/src/component/test.rs +++ b/src/component/test.rs @@ -125,7 +125,7 @@ pub struct Component { impl Component { pub fn new(in_buffer: Vec) -> Self { - env_logger::builder().is_test(true).init(); + let _ = env_logger::builder().is_test(true).try_init(); Component { in_buffer: VecDeque::from( diff --git a/src/main.rs b/src/main.rs index 3ddd25f..69fb3df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -54,6 +54,7 @@ async fn main() -> Result<(), Error> { let server = "::1"; let port = 5347u16; + #[cfg(not(test))] env_logger::init(); let mut component = Component::new(jid, passwd, server, port).await.unwrap();