Ask Your Question
1

How can I disable smach state transition log messages?

asked 2012-09-13 23:09:06 -0600

updated 2012-09-13 23:15:22 -0600

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/

edit retag flag offensive close merge delete

Comments

Does rxloggerlevel help? Maybe they are in a named logger.

dornhege gravatar imagedornhege ( 2012-09-14 00:02:50 -0600 )edit

I don't think rxloggerlevel works for Python logging.

joq gravatar imagejoq ( 2012-09-14 05:22:12 -0600 )edit
Ricardo Tellez gravatar imageRicardo Tellez ( 2012-09-29 00:34:56 -0600 )edit

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.

130s gravatar image130s ( 2013-11-20 01:29:34 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
3

answered 2012-09-14 08:13:00 -0600

jbohren gravatar image

updated 2012-09-14 08:15:11 -0600

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.

edit flag offensive delete link more
2

answered 2012-09-14 05:28:25 -0600

joq gravatar image

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.

edit flag offensive delete link more

Comments

I think that these really should be DEBUG messages instead of INFO.

AHornung gravatar imageAHornung ( 2012-09-14 06:39:27 -0600 )edit

I agree, hence the defect ticket suggestion.

joq gravatar imagejoq ( 2012-09-14 07:17:27 -0600 )edit

I think the SMACH developers agree that it should at least be an option.

jbohren gravatar imagejbohren ( 2012-09-14 08:09:46 -0600 )edit
1

answered 2013-11-20 01:19:37 -0600

Siegfried Gevatter gravatar image

updated 2013-11-20 01:20:11 -0600

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())
edit flag offensive delete link more

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: 2012-09-13 23:09:06 -0600

Seen: 725 times

Last updated: Nov 20 '13