ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
4

Can the log level of a (python) ROS node be changed dynamically?

asked 2012-10-01 18:25:56 -0500

updated 2014-01-28 17:13:48 -0500

ngrennan gravatar image

I wonder if it is possible (and if not if it makes sense) to change the log level of a python node during runtime.

The node could connect to a special purpose topic where the log level for the node can be announced. This would allow to have a node running without the debug messages being published to /rosout, but if necessary the log level could be switched to debug if the node is not running as expected.

Of course you can always change the init_node line and re-run the node, but in some occasions a more transparent solution might be useful?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2021-12-03 12:55:28 -0500

JeremyRoy gravatar image

updated 2021-12-03 12:56:35 -0500

Although not currently/officially supported by the rospy api, this can be accomplished through a simple function. See the accepted answer for Change python node log level while running.

edit flag offensive delete link more

Comments

1

Since this old thread is about ROS1, which is basically frozen for new feature addition, non-complex workaround is probably an acceptable answer and solution. So I marked this as a selected answer.

130s gravatar image 130s  ( 2021-12-06 13:39:25 -0500 )edit
3

answered 2012-10-02 06:25:22 -0500

joq gravatar image

That would be quite useful, but is not currently supported.

edit flag offensive delete link more
3

answered 2012-10-26 08:23:26 -0500

130s gravatar image

updated 2012-10-26 08:24:50 -0500

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-10-01 18:25:56 -0500

Seen: 1,761 times

Last updated: Dec 03 '21