How do I configure log level for a node?
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.mypackagename=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.mypackagename
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.
Asked by galou on 2015-11-13 04:30:00 UTC
Answers
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
Asked by Purplefishies on 2020-02-14 08:38:54 UTC
Comments