Browse Source

Add `wire` target logs for tracing messages

Activating logs for the `wire` target will trace all incoming and
outgoing messages for both maker and taker.
update-blockstream-electrum-server-url
Thomas Eizinger 3 years ago
parent
commit
21b20f6fdb
No known key found for this signature in database GPG Key ID: 651AC83A6C6C8B96
  1. 4
      daemon/src/connection.rs
  2. 6
      daemon/src/maker_inc_connections.rs

4
daemon/src/connection.rs

@ -59,6 +59,8 @@ impl State {
}
};
tracing::trace!(target = "wire", "Sending {}", msg_str);
write
.send(msg)
.await
@ -379,7 +381,7 @@ impl Actor {
}
};
tracing::trace!("Received '{}'", msg);
tracing::trace!(target = "wire", "Received {}", msg);
match msg {
wire::MakerToTaker::Heartbeat => {

6
daemon/src/maker_inc_connections.rs

@ -118,6 +118,8 @@ impl Connection {
async fn send(&mut self, msg: wire::MakerToTaker) -> Result<()> {
let msg_str = msg.to_string();
tracing::trace!(target = "wire", taker_id = %self.taker, "Sending {}", msg_str);
self.write
.send(msg)
.await
@ -380,6 +382,10 @@ impl Actor {
#[xtra_productivity(message_impl = false)]
impl Actor {
async fn handle_msg_from_taker(&mut self, msg: FromTaker) -> Result<()> {
let msg_str = msg.msg.to_string();
tracing::trace!(target = "wire", taker_id = %msg.taker_id, "Received {}", msg_str);
use wire::TakerToMaker::*;
match msg.msg {
Protocol { order_id, msg } => match self.setup_actors.get_connected(&order_id) {

Loading…
Cancel
Save