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

How do I configure log level for a node?

asked 2015-11-13 03:30:00 -0600

galou gravatar image

In the wiki page "http://wiki.ros.org/rosconsole#Configuration", it is stated that one can change the configuration for a package with log4j.logger.ros.my_package_name=DEBUG. However, this is not apparently not for a node but for a package and secondly, by supposing that "node" is meant and not "package", this simply adds a logger ros.my_package_name which is not used because the used logger is ros (or ros.roscpp, I still didn't find out). This logger is added to all nodes.

To sum up, I'm confused about loggers and don't know if all nodes use the same logger or each node use its own instance of a logger.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-02-14 07:38:54 -0600

Purplefishies gravatar image

updated 2020-02-14 07:39:47 -0600

I know this is a late addition, but the fix I had for this was to have a launch file that specified the env var ROSCONSOLE_CONFIG_FILE for the node that needed to run with debugging

if you had a package my_node

<launch>
 <node pkg="my_node" type="first_node" name="first_node" />
  <env name="ROSCONSOLE_CONFIG_FILE" value="$(find my_node)/launch/rosconsole.config"/>  
  <node pkg="my_node" type="second_node" name="second_node" />
</launch>

The second node would have the logging enabled for the level you requested in $(rospack find my_node)/launch/rosconsole.config

edit flag offensive delete link more

Question Tools

Stats

Asked: 2015-11-13 03:30:00 -0600

Seen: 1,673 times

Last updated: Nov 13 '15