Ask Your Question
3

Selecting log level in ROS2 launch file

asked 2018-12-25 14:30:43 -0500

Teckel gravatar image

updated 2018-12-25 14:31:44 -0500

Nodes defined in launch file have the INFO log level as a default value I would like to know how to change it so that it also logs DEBUG level strings or other types of logging.

launch_ros.actions.Node(package='demo_nodes_cpp', node_executable='talker', output='screen', parameters=[config_file])

Thank you

edit retag flag offensive close merge delete

Comments

Any updates?

yossi_ov gravatar image yossi_ov  ( 2019-11-11 01:38:51 -0500 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2019-11-21 22:27:02 -0500

johnconn gravatar image

I know this question was asked before dashing was released, and that eloquent is being released soon with changed syntax...

But for dashing, you can use the following syntax:

  launch_ros.actions.Node(package='demo_nodes_cpp',
    node_executable='talker',
    output='screen', 
     parameters=[config_file],
    arguments=[('__log_level:=debug')])

This will set the log level to debug for every node being run in this process (rcl, rclcpp, the rmw layer). I don't know how to restrict the log changes to just "talker" node unfortunately. I think logging is still a work in progress.

edit flag offensive delete link more

Comments

Can anyone update on how to do this in Eloquent/Foxy? The direct translation to the new command line format does not work:

launch_ros.actions.Node(
    package='demo_nodes_cpp',
    executable='talker',
    output='screen', 
    arguments=[('--ros-args --log-level debug')]
)
rasmusan- gravatar image rasmusan-  ( 2020-09-10 03:33:34 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

4 followers

Stats

Asked: 2018-12-25 14:30:43 -0500

Seen: 559 times

Last updated: Sep 10