Skip to content

feat: Add per-node log level support via NodeOptions#3092

Open
penww wants to merge 1 commit intoros2:rollingfrom
penww:rolling
Open

feat: Add per-node log level support via NodeOptions#3092
penww wants to merge 1 commit intoros2:rollingfrom
penww:rolling

Conversation

@penww
Copy link

@penww penww commented Mar 11, 2026

Add a log_level option to NodeOptions that allows setting the initial log severity for a node at construction time, enabling per-component log level customization in component containers.

Description

Fixes (#3091)

User could set log level for single node and component.

  • Set component log_level with CLI:
ros2 component load /ComponentManager <PKG> <PLUGIN> --log-level debug
  • Set component log_level with launch:
def generate_launch_description():
    return LaunchDescription([ComposableNodeContainer(
        name='component_demo_container',
        namespace='',
        package='rclcpp_components',
        executable='component_container',
        composable_node_descriptions=[
            ComposableNode(
                package='<PKG>',
                plugin='<PLUGIN>',
                log_level='DEBUG',  # component log level
            ),
        ],
        arguments=['--ros-args', '--log-level', 'DEBUG'],  # container log level
    )])

Is this user-facing behavior change?

No, the additional log level option is optional and default back to the current behavior.

Did you use Generative AI?

Partially with Claude Sonnet 4.6

Additional Information

Look at: #3091

@penww penww force-pushed the rolling branch 2 times, most recently from dbb1e05 to 4fad28c Compare March 12, 2026 06:59
@penww
Copy link
Author

penww commented Mar 16, 2026

@alsora could you help to review this PR?

Add a log_level option to NodeOptions that allows setting the
initial log severity for a node at construction time, enabling
per-component log level customization in component containers.

Signed-off-by: Peng Wang <penwang@qti.qualcomm.com>
@penww
Copy link
Author

penww commented Mar 21, 2026

It seems CI failed by other code, could you help to re-run CI? @jmachowinski

--- stderr: rclcpp                               
/opt/ros2_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/subscription_base.cpp: In member function ‘bool rclcpp::SubscriptionBase::is_cft_supported() const’:
/opt/ros2_ws/src/ros2/rclcpp/rclcpp/src/rclcpp/subscription_base.cpp:486:10: error: ‘rcl_subscription_is_cft_supported’ was not declared in this scope; did you mean ‘rcl_subscription_is_cft_enabled’?
  486 |   return rcl_subscription_is_cft_supported(subscription_handle_.get());
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |          rcl_subscription_is_cft_enabled
gmake[2]: *** [CMakeFiles/rclcpp.dir/build.make:1292: CMakeFiles/rclcpp.dir/src/rclcpp/subscription_base.cpp.o] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants