Skip to content

Commit

Permalink
BONUS: improve participant discovery traces
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
  • Loading branch information
juanlofer-eprosima committed Sep 6, 2024
1 parent 47768e9 commit dd1185c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 20 deletions.
31 changes: 21 additions & 10 deletions ddspipe_participants/src/cpp/participant/dds/CommonParticipant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,24 @@ void CommonParticipant::on_participant_discovery(
}
else if (reason == fastdds::rtps::ParticipantDiscoveryStatus::CHANGED_QOS_PARTICIPANT)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Participant " << info.guid << " changed QoS.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Participant " << info.guid <<
" changed QoS.");
}
else if (reason == fastdds::rtps::ParticipantDiscoveryStatus::REMOVED_PARTICIPANT)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Participant " << info.guid << " removed.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Participant " << info.guid << " removed.");
}
else if (reason == fastdds::rtps::ParticipantDiscoveryStatus::DROPPED_PARTICIPANT)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Participant " << info.guid << " dropped.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Participant " << info.guid << " dropped.");
}
else if (reason == fastdds::rtps::ParticipantDiscoveryStatus::IGNORED_PARTICIPANT)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Participant " << info.guid << " ignored.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Participant " << info.guid << " ignored.");
}
}
}
Expand Down Expand Up @@ -275,20 +280,23 @@ void CommonParticipant::on_data_reader_discovery(
}
else if (reason == fastdds::rtps::ReaderDiscoveryStatus::CHANGED_QOS_READER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Reader " << info.guid << " changed TopicQoS.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Reader " << info.guid << " changed TopicQoS.");

this->discovery_database_->update_endpoint(info_reader);
}
else if (reason == fastdds::rtps::ReaderDiscoveryStatus::REMOVED_READER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Reader " << info.guid << " removed.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Reader " << info.guid << " removed.");

info_reader.active = false;
this->discovery_database_->update_endpoint(info_reader);
}
else if (reason == fastdds::rtps::ReaderDiscoveryStatus::IGNORED_READER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Reader " << info.guid << " ignored.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Reader " << info.guid << " ignored.");

// Do not notify discovery database (design choice that might be changed in the future)
}
Expand Down Expand Up @@ -322,20 +330,23 @@ void CommonParticipant::on_data_writer_discovery(
}
else if (reason == fastdds::rtps::WriterDiscoveryStatus::CHANGED_QOS_WRITER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Writer " << info.guid << " changed TopicQoS.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Writer " << info.guid << " changed TopicQoS.");

this->discovery_database_->update_endpoint(info_writer);
}
else if (reason == fastdds::rtps::WriterDiscoveryStatus::REMOVED_WRITER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Writer " << info.guid << " removed.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Writer " << info.guid << " removed.");

info_writer.active = false;
this->discovery_database_->update_endpoint(info_writer);
}
else if (reason == fastdds::rtps::WriterDiscoveryStatus::IGNORED_WRITER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Writer " << info.guid << " ignored.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Writer " << info.guid << " ignored.");

// Do not notify discovery database (design choice that might be changed in the future)
}
Expand Down
33 changes: 23 additions & 10 deletions ddspipe_participants/src/cpp/participant/rtps/CommonParticipant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,24 @@ void CommonParticipant::on_participant_discovery(
}
else if (reason == fastdds::rtps::ParticipantDiscoveryStatus::CHANGED_QOS_PARTICIPANT)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Participant " << info.guid << " changed QoS.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Participant " << info.guid <<
" changed QoS.");
}
else if (reason == fastdds::rtps::ParticipantDiscoveryStatus::REMOVED_PARTICIPANT)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Participant " << info.guid << " removed.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Participant " << info.guid << " removed.");
}
else if (reason == fastdds::rtps::ParticipantDiscoveryStatus::DROPPED_PARTICIPANT)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Participant " << info.guid << " dropped.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Participant " << info.guid << " dropped.");
}
else if (reason == fastdds::rtps::ParticipantDiscoveryStatus::IGNORED_PARTICIPANT)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Participant " << info.guid << " ignored.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Participant " << info.guid << " ignored.");
}
}
}
Expand All @@ -132,20 +137,24 @@ void CommonParticipant::on_reader_discovery(
}
else if (reason == fastdds::rtps::ReaderDiscoveryStatus::CHANGED_QOS_READER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Reader " << info.guid << " changed TopicQoS.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Reader " << info.guid <<
" changed TopicQoS.");

this->discovery_database_->update_endpoint(info_reader);
}
else if (reason == fastdds::rtps::ReaderDiscoveryStatus::REMOVED_READER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Reader " << info.guid << " removed.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Reader " << info.guid << " removed.");

info_reader.active = false;
this->discovery_database_->update_endpoint(info_reader);
}
else if (reason == fastdds::rtps::ReaderDiscoveryStatus::IGNORED_READER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Reader " << info.guid << " ignored.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Reader " << info.guid << " ignored.");

// Do not notify discovery database (design choice that might be changed in the future)
}
Expand Down Expand Up @@ -173,20 +182,24 @@ void CommonParticipant::on_writer_discovery(
}
else if (reason == fastdds::rtps::WriterDiscoveryStatus::CHANGED_QOS_WRITER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Writer " << info.guid << " changed TopicQoS.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Writer " << info.guid <<
" changed TopicQoS.");

this->discovery_database_->update_endpoint(info_writer);
}
else if (reason == fastdds::rtps::WriterDiscoveryStatus::REMOVED_WRITER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Writer " << info.guid << " removed.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Writer " << info.guid << " removed.");

info_writer.active = false;
this->discovery_database_->update_endpoint(info_writer);
}
else if (reason == fastdds::rtps::WriterDiscoveryStatus::IGNORED_WRITER)
{
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY, "Writer " << info.guid << " ignored.");
EPROSIMA_LOG_INFO(DDSPIPE_DISCOVERY,
configuration_->id << " participant : " << "Writer " << info.guid << " ignored.");

// Do not notify discovery database (design choice that might be changed in the future)
}
Expand Down

0 comments on commit dd1185c

Please sign in to comment.