Why the .config file doesn't works for me
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~