ros2 / rmw_fastrtps

Implementation of the ROS Middleware (rmw) Interface using eProsima's Fast RTPS.
Apache License 2.0
147 stars 116 forks source link

add documentation how to get the fastdds log information for debugging #735

Closed fujitatomoya closed 6 months ago

fujitatomoya commented 6 months ago

Feature request

Feature description

This is documentation feature request to see and print the detail log information in fastdds library. We sometimes need to go deep inside of fastdds library information during debugging the problems and behavior even the application is running on top of ROS 2. Using XML file configuration to change the log information provided by fastdds library would be really useful for development and issue report.

Implementation considerations

I think we can add the example XML file configuration to https://github.com/ros2/rmw_fastrtps?tab=readme-ov-file#example, and provide the URL link for more detailed setting as Fast-DDS.

fujitatomoya commented 6 months ago

@Barry-Xu-2018 @iuhilnehc-ynos Do you guys happen to know this? I am willing to make this doc once i figure out how to do that.

CC: @clalancette @MiguelCompany @EduPonz

Barry-Xu-2018 commented 6 months ago

@fujitatomoya

Do you means this document https://fast-rtps.docs.eprosima.com/en/v2.3.1/fastdds/xml_configuration/log.html#logprofiles?
We haven't used this configuration before.

EduPonz commented 6 months ago

This is precisely what you'd need. It is just another profile to add to your XML, as simple as that

iuhilnehc-ynos commented 6 months ago

IIUC, the print the detail log information metioned by @fujitatomoya is about the INFO message.

Please notice that:

  1. the INFO message in the Fast-DDS is OFF by default.
  2. the default verbosity is Log::Error

It seems we need to re-compile the Fast-DDS and call the rmw_set_log_severity if we want to get the the detail log. I don't think we can only update rmw_fastrtps to see and print the detail log information in fastdds library.

EduPonz commented 6 months ago

In case you want INFO messages, then @iuhilnehc-ynos is indeed correct, you'd need to activate them at build time (see here). Mind that they are deactivated due to performance considerations.

fujitatomoya commented 6 months ago

@Barry-Xu-2018 @iuhilnehc-ynos @EduPonz

thanks, actually i was looking for something @iuhilnehc-ynos mentioned. (where to sink is out of scope.) sometimes we want to have the information, debug log to check the Fast-DDS internal even with ROS 2 development. Having and asking user to rebuild the Fast-DDS would be not really helpful for that case... I also understand the performance concern.

Anyway now i see that we need to rebuild the source code (and i can live with that), this was more like a question, so probably we can come back to this topic if necessary. closing this for now.

EduPonz commented 6 months ago

With recent colcon versions is possible to use Fast DDS from an overlay (before colcon had issues with this), so Fast DDS can be put in the application workspace and be built with log info when necessary

fujitatomoya commented 6 months ago

@EduPonz yeah understood, but user needs to build the source code. it would be probably nicer if user can configure the log level at the runtime.