TestComponent: ensure env_logger is initialized correctly

This is probably not the right place for it but I'm not sure where else
to put it.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2023-01-06 12:25:45 +01:00
parent 5ef59d9197
commit d3e013a999
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2
2 changed files with 2 additions and 1 deletions

View file

@ -125,7 +125,7 @@ pub struct Component {
impl Component {
pub fn new(in_buffer: Vec<Element>) -> Self {
env_logger::builder().is_test(true).init();
let _ = env_logger::builder().is_test(true).try_init();
Component {
in_buffer: VecDeque::from(

View file

@ -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();