Improve logging a bit
This commit is contained in:
parent
3c70ae1da3
commit
87ea9aa668
5 changed files with 11 additions and 2 deletions
BIN
Cargo.lock
generated
BIN
Cargo.lock
generated
Binary file not shown.
|
@ -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>"]
|
||||||
|
|
||||||
|
|
6
core.pkl
6
core.pkl
|
@ -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"
|
||||||
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -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"),
|
||||||
|
|
Loading…
Reference in a new issue