Log disconnect events

This commit is contained in:
Joscha 2023-01-23 22:48:05 +01:00
parent 29b7d0ed7a
commit 63464fdc59

View file

@ -8,7 +8,7 @@ use std::sync::{Arc, Mutex};
use std::time::Duration;
use cookie::{Cookie, CookieJar};
use log::{debug, warn};
use log::{debug, info, warn};
use tokio::select;
use tokio::sync::{mpsc, oneshot};
use tokio_tungstenite::tungstenite;
@ -440,6 +440,13 @@ impl Instance {
break;
}
}
Ok(Data::DisconnectEvent(ev)) => {
if ev.reason == "authentication changed" {
info!("{}: Disconnected because {}", config.name, ev.reason);
} else {
warn!("{}: Disconnected because {}", config.name, ev.reason);
}
}
_ => {}
}