SMACC icon indicating copy to clipboard operation
SMACC copied to clipboard

Suppress logging messages from SMACC

Open sarahallen111 opened this issue 2 years ago • 4 comments

I am working on a project that utilizes the SMACC library. We are using ROS logging for our package, but the logs are being spammed by the logging calls coming from inside the SMACC library. Is there any way to suppress the SMACC library logging messages, while still allowing the logging from our package?

┆Issue is synchronized with this Jira Task by Unito ┆Link To Issue: https://robosoft-ai.atlassian.net/browse/SMACC1-1

sarahallen111 avatar Sep 16 '22 17:09 sarahallen111

Hello. We are currently working in an improvement to deactivate smacc logging via rosargs.

By the moment, one useful workaround would be segregating the smacc output in a different terminal. In your launch file you can use a launch prefix to move all that output to an xterm windows, like this:

<node pkg="packagename" type="myStateMachineNode" prefix="xterm -xrm 'XTerm*scrollBar:  true' -xrm 'xterm*rightScrollBar: true' -hold -sl 10000 -e">
...
</node>

pabloinigoblasco avatar Sep 19 '22 17:09 pabloinigoblasco

Hi, thanks for the response.

We can output the logs of the entire node to xterm, but there's currently nothing in place to let us separate the library logs from our SMACC implementation's logs, since they are the same node, correct?

logdan avatar Sep 19 '22 20:09 logdan

I understand your concern.

I am thinking now and I think that also should be possible just setting the smacc console level to WARN or to ERROR or to FATAL. This would make the logging system skip DEBUG an info messages.

Please have a look to these references:

https://github.com/reelrbtx/SMACC/blob/76dceb90411c2e4b13e4ae78c0af67d1acfb3333/smacc_sm_reference_library/sm_dance_bot/config/rosconsole.config

https://github.com/reelrbtx/SMACC/blob/76dceb90411c2e4b13e4ae78c0af67d1acfb3333/smacc_sm_reference_library/sm_dance_bot/launch/sm_dance_bot.launch#L22

We could use something like:

log4j.logger.smacc=FATAL

you might need to replicate this with other smacc client libraries, but I think it should work.

I think we should use this rosconsole file for all of our example, making easy to the user configure them.

Please, make us know if that works for you.

pabloinigoblasco avatar Sep 19 '22 20:09 pabloinigoblasco

I do something similar, with the rosconsole.config containing something like this:

log4j.logger.ros.smacc=ERROR
log4j.logger.ros.my_impl_name=INFO

This seems to suppress the smacc library messages, while allowing INFO from my_impl_name through.

katettudelft avatar Oct 10 '22 13:10 katettudelft

Closing this one out as answered.

brettpac avatar May 10 '24 18:05 brettpac