Ask Your Question
0

Why the .config file doesn't works for me

asked 2015-11-21 06:02:58 -0500

ChenJinluo gravatar image

updated 2015-11-21 06:16:30 -0500

Ubuntu: 12.04

ROS: Hydro

I am learning to set the level of logging message, however, I find that my .config doesn't work.

This is my source code in example1.cpp:

#include <ros/ros.h>
int main( int argc, char **argv )
{
  ros::init( argc, argv, "example1" );
  //ROS_DEBUG( "This is a DEBUG message!" );   
 ROS_INFO("This is an INFO message!");
 ROS_WARN("This is a WARN message!");
 ROS_ERROR("This is an ERROR message!");
 ROS_FATAL("This is a FATAL message!");

 ros::spinOnce();
 return EXIT_SUCCESS;
}

chapter3_tutorials.config:

log4j.logger.ros.chapter3_tutorials.config=ERROR

example1.launch :

<?xml version="1.0" encoding="UTF-8"?>
<launch>
  <!-- Logger config -->
  <env name="ROSCONSOLE_CONFIG_FILE"
       value="$(find chapter3_tutorials)/config/chapter3_tutorials.config"/>

  <!-- Example 1 -->
  <node pkg="chapter3_tutorials" type="example1" name="example1"
        output="screen"/>
</launch>

After I roslaunch the code, it should print only logging message ERROR and FATAL, But the INFO and WARN also are printed.

How to solve it? Thank you~

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-11-21 12:10:27 -0500

Looks like there is one "config" too much, try this:

log4j.logger.ros.chapter3_tutorials=ERROR
edit flag offensive delete link more

Comments

Oh, I was stupid. Thank you very much!~

ChenJinluo gravatar image ChenJinluo  ( 2015-11-21 19:40:32 -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

1 follower

Stats

Asked: 2015-11-21 06:02:58 -0500

Seen: 83 times

Last updated: Nov 21 '15