Skip to content

Commit

Permalink
Add debug logs (Readers/Writers creation)
Browse files Browse the repository at this point in the history
  • Loading branch information
JEnoch committed Dec 1, 2023
1 parent 38cfa93 commit 16b622a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zenoh-plugin-ros2dds/src/route_publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ impl RoutePublisher<'_> {
let publisher = publisher.clone();

move |status| {
log::debug!("{route_id} MatchingStatus changed: {status:?}");
if status.matching_subscribers() {
if let Err(e) = activate_dds_reader(
&dds_reader,
Expand Down Expand Up @@ -397,6 +398,7 @@ fn activate_dds_reader(
type_info: &Option<Arc<TypeInfo>>,
publisher: &Arc<Publisher<'static>>,
) -> Result<(), String> {
log::debug!("{route_id}: create Reader with {reader_qos:?}");
let topic_name: String = format!("rt{}", ros2_name);
let type_name = ros2_message_type_to_dds_type(ros2_type);
let read_period = get_read_period(&context.config, ros2_name);
Expand Down Expand Up @@ -436,6 +438,7 @@ fn deactivate_dds_reader(
route_id: &str,
ros_discovery_mgr: &Arc<RosDiscoveryInfoMgr>,
) {
log::debug!("{route_id}: delete Reader");
let reader = dds_reader.swap(DDS_ENTITY_NULL, Ordering::Relaxed);
if reader != DDS_ENTITY_NULL {
// remove reader's GID from ros_discovery_info message
Expand Down
2 changes: 2 additions & 0 deletions zenoh-plugin-ros2dds/src/route_subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ impl Drop for RouteSubscriber<'_> {
Err(e) => log::warn!("{self}: {e}"),
}

log::debug!("{self}: delete Writer");
if let Err(e) = delete_dds_entity(self.dds_writer) {
log::warn!("{}: error deleting DDS Reader: {}", self, e);
}
Expand Down Expand Up @@ -117,6 +118,7 @@ impl RouteSubscriber<'_> {
let type_name = ros2_message_type_to_dds_type(&ros2_type);
let queries_timeout = context.config.get_queries_timeout_tl_sub(&ros2_name);

log::debug!("Route Subscriber ({zenoh_key_expr} -> {ros2_name}): create Writer with {writer_qos:?}");
let dds_writer = create_dds_writer(
context.participant,
topic_name,
Expand Down

0 comments on commit 16b622a

Please sign in to comment.