Add per composable node log_level support#531
Conversation
Signed-off-by: Peng Wang <penwang@qti.qualcomm.com>
| 'ERROR': rcl_interfaces.msg.Log.ERROR, | ||
| 'FATAL': rcl_interfaces.msg.Log.FATAL, | ||
| } | ||
| request.log_level = log_level_map.get(log_level_str, 0) |
There was a problem hiding this comment.
this fallback is NOT great for the user application. if user sets typos log_level='debig', it silently sets it to UNSET and the user will not be notified configuration gone wrong. i think that this behavior is actually worse then raising the exception, what do you think? i say, we should enforce the check and return error would be better. and again this should be done with rclpy get_logging_severity_from_string?
| log_level_str = perform_substitutions( | ||
| context, composable_node_description.log_level).upper() | ||
| log_level_map = { | ||
| 'DEBUG': rcl_interfaces.msg.Log.DEBUG, |
There was a problem hiding this comment.
should be rcl_interfaces.msg.LoggerLevel.
| 'DEBUG': rcl_interfaces.msg.Log.DEBUG, | ||
| 'INFO': rcl_interfaces.msg.Log.INFO, | ||
| 'WARN': rcl_interfaces.msg.Log.WARN, | ||
| 'WARNING': rcl_interfaces.msg.Log.WARN, |
There was a problem hiding this comment.
docstring does not mention about this string though... we should add it to the help docstring?
|
Tick the box to add this pull request to the merge queue (same as
|
Description
Fixes # (ros2/rclcpp#3091)
Is this user-facing behavior change?
No, this change add new parameter for
ComposableNode, not affect the existing functions.Did you use Generative AI?
Yes, partially with Claude Sonnet 4.6.
Additional Information
Example for per component log level feature enabled:
Related PR: ros2/rclcpp#3092, ros2/ros2cli#1212