Improve logging a bit
This commit is contained in:
parent
3c70ae1da3
commit
e9817062a4
3 changed files with 10 additions and 1 deletions
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