From 5f196a2a102ba0af31e06aefbcc373c7300e1eb1 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 2 Mar 2019 13:17:22 +0800 Subject: [PATCH] crimson/net: log tx/rx messages Signed-off-by: Kefu Chai --- src/crimson/net/SocketConnection.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/crimson/net/SocketConnection.cc b/src/crimson/net/SocketConnection.cc index 7f0f4fc4cb9..a0268ef949f 100644 --- a/src/crimson/net/SocketConnection.cc +++ b/src/crimson/net/SocketConnection.cc @@ -71,6 +71,7 @@ seastar::future SocketConnection::is_connected() seastar::future<> SocketConnection::send(MessageRef msg) { + logger().debug("{} --> {} === {}", messenger, get_peer_addr(), *msg); return seastar::smp::submit_to(shard_id(), [this, msg=std::move(msg)] { if (state == state_t::closing) return seastar::now(); @@ -214,6 +215,8 @@ seastar::future<> SocketConnection::read_message() auto msg_ref = MessageRef{msg, add_ref}; // start dispatch, ignoring exceptions from the application layer seastar::with_gate(pending_dispatch, [this, msg = std::move(msg_ref)] { + logger().debug("{} <= {}@{} === {}", messenger, + msg->get_source(), get_peer_addr(), *msg); return dispatcher.ms_dispatch( seastar::static_pointer_cast(shared_from_this()), std::move(msg)) -- 2.39.5