-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable setting log levels in DDS implementation #124
Conversation
…l DDS api's * This patch enables support for three basic log levels * There needs an API inside the DDS specific rmw implementation i.e rmw_fastrtps/rmw_opensplice etc to convert the enum to DDS specific variable Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com>
The package |
I'll change the patch accordingly, I did check rcutils for the same. But missed checking for the actual enum. |
Hi @dirk-thomas I read the code from rcutils and rmw, find two ways of doing it.
Let me know your thoughts on this. |
I would suggest to define an rmw specific enum but use the enum values from rcutils to define their values. That way the rmw API uses rmw types but is still compatible with rcutils. |
ros2#124 (comment) Using rcutils based log level, mapping them onto rmw specific ones. Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com>
Hi @dirk-thomas Have update the pull request based on the discussions above. Could you review the changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beside the minor comments the added enum looks fine.
Please also add the new function declaration to actually pass the log severity.
rmw/include/rmw/types.h
Outdated
@@ -229,6 +231,18 @@ typedef struct RMW_PUBLIC_TYPE rmw_message_info_t | |||
|
|||
enum {RMW_QOS_POLICY_DEPTH_SYSTEM_DEFAULT = 0}; | |||
|
|||
// Creating a map of rcutil log level types to | |||
// rmw specific types. Check with dds available types | |||
// before using these. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the DDS reference from the comment since the rmw interface doesn't require it to be implemented by DDS.
rmw/include/rmw/types.h
Outdated
// Creating a map of rcutil log level types to | ||
// rmw specific types. Check with dds available types | ||
// before using these. | ||
enum RMW_PUBLIC_TYPE rmw_log_level_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use consistent terms: severity
instead of level
.
rmw/include/rmw/types.h
Outdated
enum RMW_PUBLIC_TYPE rmw_log_level_t | ||
{ | ||
RMW_LOG_SEVERITY_DEBUG = RCUTILS_LOG_SEVERITY_DEBUG, | ||
RMW_LOG_SEVERITY_INFO = RCUTILS_LOG_SEVERITY_INFO, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the double space to align the equal sign.
Same next line.
…onsistency. Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com>
@dirk-thomas fixed the comments. Have a look and let me know. |
Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>
ros2/rmw#124 url on rmw. The patch enables setting log severity from userland applications. The parameter passed is defined inside rmw/include/types.h Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com>
This comment is still pending. |
@dirk-thomas ros2/rmw_implementation#30 (comment) have implemented the same here. |
The new function also needs to be declared in this file: https://github.com/ros2/rmw/blob/master/rmw/include/rmw/rmw.h And then it needs to be implemented for all currently supported rmw implementations: rmw_fastrtps_cpp, rmw_connext_cpp, rmw_opensplice_cpp. |
patches across ros2 sources for setting log levels inside DDS implementation Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com>
@dirk-thomas the API is included in rmw/rmw.h. I'll update the rmw_dds specific ones in other commits. |
…as'nt needed Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com>
ros2/rmw#124 * The API defined is used to set the logging level particular to the DDS implementation. * This change is specific to DDS type Fast-RTPS. * The file is named as rmw_configure since we could write API's of type 'system level config setting' types here. Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>
Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com>
I have added the phrase "Connect to " to the initial description of the related PRs so that they are being grouped on the Waffle.io board. |
@dirk-thomas I've updated the patch sets on all the linked commits. Could you review? Except for one discussion which is still active. |
@dirk-thomas @dhood Could you please review this patch? This is connected to another approved patch by Dirk |
Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>
@dirk-thomas Have update all the connecting PR's to master. Could you please trigger the CI build? Just asking, may I trigger the build in future? (If I'm allowed to do so, could you share an link or document for the same?) |
The code doesn't compile. Please make sure to compile your changes locally, run the tests and once that passed successfully request a new round of CI build.
Currently we can't provide access to ci.ros2.org. In the future build.ros2.org should provide that service to the community. |
@dirk-thomas fixed the error, creeped in due to the change from error msg setting to parameterized logging made. Could you check now? I've compiled, tested. And, it is passing locally. |
@dirk-thomas Done. Missed them again! I need to practice "ros" style more. Sorry again. |
Please also address the compiler warnings reported: http://ci.ros2.org/job/ci_linux/3848/warnings22Result/new/ |
@dirk-thomas checked, it is due to unused parameter "severity" with our new API's, would you like a (void) severity; declaration just to nullify the warning. The better solution would be to implement the logging usage with connext and opensplice. Let me know your thoughts on this. |
As mentioned before implementing the currently empty functions is the goal. If you would like to merge the current set of PR before that happens please use |
@dirk-thomas Thanks. I've made the necessary changes to prevent the warning on the connected patches. |
@dirk-thomas I checked those from the logs. They don't seem like regressions because of our changes. Could you let me know if you've found the cause for the same? |
* The patch follows the discussion at this ros2/rmw#124 url on rmw. The patch enables setting log severity from userland applications. The parameter passed is defined inside rmw/include/types.h Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com> * Changing rmw_log_severity_t from const * to rmw_log_severity_t addressing comments Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com>
* Fastrtps supports rich logging facilities, which could be used on any ros2 development. * To enable the same, enable setting log levels from rmw_fastrtps layers, * Add generic logging level parameters to 'rmw.h' which would be used by other layers above like rcl/rclcpp. * Hide DDS specific implementation inside rmw_fastrtps. Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com> * The changes follow the discussions ros2/rmw#124 * The API defined is used to set the logging level particular to the DDS implementation. * This change is specific to DDS type Fast-RTPS. * The file is named as rmw_configure since we could write API's of type 'system level config setting' types here. Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com> * Rename file from rmw_fastrtps_configure to rmw_logging, which follows the patterns being used already. like rmw_node, rmw_publisher.. Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com> * - Fix, coding errors. - Renmae API to suite ros styles Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com> * Fix ament_cpplint warnings Signed-off-by: Sriram Raghunathan <sriram.max@gmail.com> * Remove utility function to create a 'error' returnable API for setting logging Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com> * Fix, logging msg bug. * Modify logging mapping for type 'debug' from warning to info. Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com> * order log levels, use different local variable name, include unknown severity in error message * Fix error due to parameterized logging * Fix code style issues from uncrustify
Thank you for the patches. Please try to follow up with pull requests to add the missing implementation for Connext and OpenSplice when you have a chance. |
Thank you. Sure, I'll look into it. |
…l DDS api's
rmw_fastrtps/rmw_opensplice etc to convert the enum to DDS specific variable
Signed-off-by: Sriram Raghunathan sriram.max@gmail.com