From 63464fdc59f24774cb96b7a8038326a9dc7d587a Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 23 Jan 2023 22:48:05 +0100 Subject: [PATCH] Log disconnect events --- src/bot/instance.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bot/instance.rs b/src/bot/instance.rs index 3515c87..c38c4d5 100644 --- a/src/bot/instance.rs +++ b/src/bot/instance.rs @@ -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); + } + } _ => {} }