I wrote a ROS node using rosjava. When it starts up, there are a few logging outputs like:
Loading node class: MyApp.RosWrapper
Jun 18, 2015 3:12:39 PM org.ros.internal.node.client.Registrar <init>
INFO: MasterXmlRpcEndpoint URI: http://localhost:11311
Jun 18, 2015 3:12:39 PM org.ros.internal.node.client.Registrar onPublisherAdded
INFO: Registering publisher: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</mynode, http://127.0.0.1:39009/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
I've found out that rosjava uses the org.apache.commons.logging.Log
approach (see https://github.com/rosjava/rosjava_core/blob/indigo/rosjava/src/main/java/org/ros/internal/node/client/Registrar.java#L54)
To configure this, you should normally put a file called commons-logging.properties
in your Classpath. I tried to add the folder containing this file to the classpath, but nothing changed.
UPDATE:
I found out that by default rosjava uses the Jdk14Logger
class.
How can I decrease the log-level to e.g. WARN
? Where do I have to put the corresponding config files?
Disclaimer: As stated in the comment, this does not work for
rosjava
and therefore does not answer the question. I do not delete the post, however, to keep records that this has already been tried.Permanent setting
To permanently modify the log-level, create a file and add something like the following:
For ROS to use this file, you have to define the environment
ROSCONSOLE_CONFIG_FILE
and set it to the path of your file. This can be done by adding the following line to~/.bashrc
:See also the ROS wiki about rosconsole configuration.
Temporary setting
If you only want to temporarily change the log-level for a currently running node, you can use the tool
rqt_logger_level
. This will start a GUI where you can change the log-level for each running node. The settings are not stored, however, so it will be lost after restarting the node.