Skip to content

Commit

Permalink
Add channel ID to empty channel closure logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaosvex committed Oct 7, 2024
1 parent 7fa2e1a commit 4e567b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libs/spark/src/v2/RemotePeer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,13 @@ void RemotePeer::handle_close_channel(const core::CloseChannel* msg) {
auto id = gsl::narrow<std::uint8_t>(msg->channel());

if(!channels_[id]) {
LOG_WARN(log_) << "[spark] Request to close empty channel" << LOG_ASYNC;
LOG_WARN_ASYNC(log_, "[spark] Request to close empty channel ({})", id);
return;
}

channels_[id]->close();
channels_[id].reset();
LOG_DEBUG_ASYNC(log_, "[spark] Closed channel {}, requested by remote peer", id);
LOG_DEBUG_ASYNC(log_, "[spark] Closed channel ({}), requested by remote peer", id);
}

void RemotePeer::handle_channel_message(const MessageHeader& header,
Expand All @@ -293,7 +293,7 @@ void RemotePeer::handle_channel_message(const MessageHeader& header,
auto& channel = channels_[header.channel];

if(!channel || !channel->is_open()) {
LOG_WARN_ASYNC(log_, "[spark] Received message for closed channel, {}", header.channel);
LOG_WARN_ASYNC(log_, "[spark] Received message for closed channel ({})", header.channel);
return;
}

Expand Down

0 comments on commit 4e567b8

Please sign in to comment.