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:
parent
5ef59d9197
commit
d3e013a999
2 changed files with 2 additions and 1 deletions
|
@ -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(
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue