0
$\begingroup$

Rosanswers logo

Every time that smach performs a transition to a new state, it issues an Info log message indicating the time and the transition made. Is there a way of disabling those messages?.

I have read the following related questions, but found no answer to this problem:

http://answers.ros.org/question/10299/rospy-logging/

http://answers.ros.org/question/10269/rospy-logging-configuration/

http://answers.ros.org/question/9802/change-python-node-log-level-while-running/


Originally posted by Ricardo Tellez on ROS Answers with karma: 114 on 2012-09-13

Post score: 1


Original comments

Comment by dornhege on 2012-09-14:
Does rxloggerlevel help? Maybe they are in a named logger.

Comment by joq on 2012-09-14:
I don't think rxloggerlevel works for Python logging.

Comment by Ricardo Tellez on 2012-09-29:
No, it doesn't, as indicated in http://answers.ros.org/question/10299/rospy-logging/

Comment by 130s on 2013-11-20:
I updated the thread http://answers.ros.org/question/10299/rospy-logging/?answer=103161#post-id-103161. In nutshell; rospy logger can/should be tracked now.

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

Two things.

First, please create a ticket for this on the SMACH trac here: https://kforge.ros.org/smach/trac/newticket

Second, if you want to just change all of the SMACH loginfo calls to logdebug in an overlay, you can just modify line 44 of executive_smach/smach_ros/src/__init__.py and replace "rospy.loginfo" with "rospy.logdebug".

As @joq points out, there's no easy way to switch python logger levels at runtime. Because of this, we made it so that this information is reported at the info level because more often than not we wanted to see the information, but not all of the minute "debug" logging output that you would see in Python.


Originally posted by jbohren with karma: 5809 on 2012-09-14

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$
0
$\begingroup$

Rosanswers logo

As those Q&A entries say, there is currently no clean solution to your problem for Python logging.

It's ugly, but I suppose you could check out a SMACH source overlay and comment out the offending log messages in that local copy.

You can also open a defect ticket, to suppress those messages in a future release. That seems valid to me, although the SMACH developers might disagree.


Originally posted by joq with karma: 25443 on 2012-09-14

This answer was NOT ACCEPTED on the original site

Post score: 2


Original comments

Comment by AHornung on 2012-09-14:
I think that these really should be DEBUG messages instead of INFO.

Comment by joq on 2012-09-14:
I agree, hence the defect ticket suggestion.

Comment by jbohren on 2012-09-14:
I think the SMACH developers agree that it should at least be an option.

$\endgroup$
0
$\begingroup$

Rosanswers logo

I haven't tried it, but with a version of ROS newer than August 2012 it should be possible to do something like the following:

import logging
class Filter(logging.Filter):
    def filter(self, record):
        return 'State machine transitioning' not in record.msg
logging.getLogger('rosout').addFilter(MyFilter())

Originally posted by Siegfried Gevatter with karma: 119 on 2013-11-20

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.