Improve logging a bit
Some checks failed
/ build-artifacts (arm-unknown-linux-gnueabihf) (push) Failing after 23s
/ build-artifacts (x86_64-unknown-linux-gnu) (push) Failing after 10s
/ build-artifacts (x86_64-unknown-linux-musl) (push) Failing after 16s

This commit is contained in:
Tobias Reisinger 2024-05-10 13:08:51 +02:00
parent 3c70ae1da3
commit 87ea9aa668
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
5 changed files with 11 additions and 2 deletions

BIN
Cargo.lock generated

Binary file not shown.

View file

@ -1,6 +1,6 @@
[package] [package]
name = "emgauwa-core" name = "emgauwa-core"
version = "0.5.0" version = "0.5.1"
edition = "2021" edition = "2021"
authors = ["Tobias Reisinger <tobias@msrg.cc>"] authors = ["Tobias Reisinger <tobias@msrg.cc>"]

View file

@ -1 +1,5 @@
amends "package://emgauwa.app/pkl/emgauwa@0.1.0#/core.pkl" amends "package://emgauwa.app/pkl/emgauwa@0.1.1#/core.pkl"
logging {
level = "DEBUG"
}

View file

@ -78,6 +78,7 @@ impl ControllersWs {
return; return;
} }
log::trace!("Sending ping to controller");
ctx.ping(&[]); ctx.ping(&[]);
}); });
} }
@ -122,10 +123,12 @@ impl StreamHandler<Result<Message, ProtocolError>> for ControllersWs {
match msg { match msg {
Message::Ping(msg) => { Message::Ping(msg) => {
log::trace!("Received ping from controller: {:?}", msg);
self.hb = Instant::now(); self.hb = Instant::now();
ctx.pong(&msg) ctx.pong(&msg)
} }
Message::Pong(_) => { Message::Pong(_) => {
log::trace!("Received pong from controller");
self.hb = Instant::now(); self.hb = Instant::now();
} }
Message::Text(text) => match serde_json::from_str(&text) { Message::Text(text) => match serde_json::from_str(&text) {

View file

@ -77,10 +77,12 @@ impl StreamHandler<Result<ws::Message, ProtocolError>> for RelaysWs {
match msg { match msg {
ws::Message::Ping(msg) => { ws::Message::Ping(msg) => {
log::trace!("Received ping from relay-client: {:?}", msg);
self.hb = Instant::now(); self.hb = Instant::now();
ctx.pong(&msg) ctx.pong(&msg)
} }
ws::Message::Pong(_) => { ws::Message::Pong(_) => {
log::trace!("Received pong from relay-client");
self.hb = Instant::now(); self.hb = Instant::now();
} }
ws::Message::Text(_) => log::debug!("Received unexpected text in relays ws"), ws::Message::Text(_) => log::debug!("Received unexpected text in relays ws"),