-
Notifications
You must be signed in to change notification settings - Fork 100
Add per composable node log_level support #531
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
base: rolling
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,6 +40,7 @@ | |
| from launch_ros.parameter_descriptions import ParameterFile | ||
|
|
||
| import lifecycle_msgs.msg | ||
| import rcl_interfaces.msg | ||
|
|
||
| from .composable_node_container import ComposableNodeContainer | ||
| from .lifecycle_transition import LifecycleTransition | ||
|
|
@@ -321,7 +322,6 @@ def get_composable_node_load_request( | |
| combined_ns = make_namespace_absolute(prefix_namespace(base_ns, expanded_ns)) | ||
| if combined_ns is not None: | ||
| request.node_namespace = combined_ns | ||
| # request.log_level = perform_substitutions(context, node_description.log_level) | ||
| remappings = [] | ||
| global_remaps = context.launch_configurations.get('ros_remaps', None) | ||
| if global_remaps: | ||
|
|
@@ -366,4 +366,18 @@ def get_composable_node_load_request( | |
| ) | ||
| ) | ||
| ] | ||
|
|
||
| if composable_node_description.log_level is not None: | ||
| log_level_str = perform_substitutions( | ||
| context, composable_node_description.log_level).upper() | ||
| log_level_map = { | ||
| 'DEBUG': rcl_interfaces.msg.Log.DEBUG, | ||
| 'INFO': rcl_interfaces.msg.Log.INFO, | ||
| 'WARN': rcl_interfaces.msg.Log.WARN, | ||
| 'WARNING': rcl_interfaces.msg.Log.WARN, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. docstring does not mention about this string though... we should add it to the help docstring? |
||
| 'ERROR': rcl_interfaces.msg.Log.ERROR, | ||
| 'FATAL': rcl_interfaces.msg.Log.FATAL, | ||
| } | ||
| request.log_level = log_level_map.get(log_level_str, 0) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this fallback is NOT great for the user application. if user sets typos |
||
|
|
||
| return request | ||
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.
should be rcl_interfaces.msg.LoggerLevel.