TL;DR; if your Rolling project is using the RCUTILS_LOG_* and RCLCPP_* macros for ROS 2 logging in the standard way, no change will be required. If you are using the internal implementation details of those macros (like RCUTILS_LOG_CONDITION_ONCE_BEFORE), then read on for changes that will affect you.
In the soon-to-be merged PRs Hand-code logging_macros.h by clalancette · Pull Request #502 · ros2/rcutils · GitHub and Hand-code logging.hpp by clalancette · Pull Request #2870 · ros2/rclcpp · GitHub , the way that the logging macros are implemented has changed. In particular, we switched from using empy templates to hand-coding them. This has a number of benefits:
- The documentation for the logging macros will now be automatically generated into rcutils — rcutils: Rolling 7.0.1 documentation and rclcpp — rclcpp: Rolling 30.0.0 documentation
- We can remove the
empydependency from rcutils, and eventually rclcpp (it is still there for unrelated reasons). - The macros are far more maintainable and human-understandable this way. The bulk of the implementation is in a few “implementation” macros, and the user-facing macros just use these.
One downside to this change is that these are all C macros, and hence the “implementation details” of the old system will be removed. If your Rolling package is using the standard macros like RCUTILS_LOG_DEBUG or RCLCPP_DEBUG, no change at all will be required to your package. However, if your package is using any of the following macros/typedefs, it will have to be updated:
RCUTILS_CAST_DURATIONRCUTILS_LOG_COND_NAMEDRCUTILS_LOG_CONDITION_EMPTYRCUTILS_LOG_CONDITION_ONCE_BEFORERCUTILS_LOG_CONDITION_ONCE_AFTERRCUTILS_LOG_CONDITION_EXPRESSION_BEFORERCUTILS_LOG_CONDITION_EXPRESSION_AFTERRCUTILS_LOG_CONDITION_FUNCTION_BEFORERCUTILS_LOG_CONDITION_FUNCTION_AFTERRCUTILS_LOG_CONDITION_SKIPFIRST_BEFORERCUTILS_LOG_CONDITION_SKIPFIRST_AFTERRCUTILS_LOG_CONDITION_THROTTLE_BEFORERCUTILS_LOG_CONDITION_THROTTLE_AFTERRCLCPP_FIRST_ARGRCLCPP_ALL_BUT_FIRST_ARGSRclLogFilter
(to be clear, I looked at all of the packages currently released into rosdistro/rolling/distribution.yaml at master · ros/rosdistro · GitHub , and not a single one used any of these macros)
Note that we will not be backporting this to stable distributions; this change will only affect Rolling (and eventually Lyrical).
If you have questions, comments, or concerns about this change, please let us know in this thread.