Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove (potentially) recursive DEBUG statements #1823

Merged
merged 1 commit into from
Feb 3, 2020

Conversation

mjcarroll
Copy link
Member

@mjcarroll mjcarroll commented Oct 3, 2019

This is an alternative fix to #1241. This also addresses ros/rosconsole#30

When using a log level of debug, every logging statement will have console output:
Warning: recursive print statement has occurred. Throwing out recursive print.

The logic introduced in #1241 uses getCached which will cause a second logging statement to occur recursively when log level is set to debug.

Edit: This has been updated to remove the offending DEBUG statements so that it will work in all cases.

@mjcarroll mjcarroll self-assigned this Oct 3, 2019
@mjcarroll
Copy link
Member Author

mjcarroll commented Oct 3, 2019

Alternatively: this is the offending log statement:

ROS_DEBUG_NAMED("cached_parameters", "Subscribed to parameter [%s]", mapped_key.c_str());

Is it likely that people are debugging the cache in normal operation? Is this something that could be removed?

@mjcarroll mjcarroll requested a review from dirk-thomas October 3, 2019 11:38
@mjcarroll mjcarroll force-pushed the fix_recursive_print branch from f0c135e to c6a6c07 Compare October 7, 2019 14:33
@mjcarroll mjcarroll changed the title Check for parameter before querying Remove (potentially) recursive DEBUG statements Oct 7, 2019
@mjcarroll mjcarroll force-pushed the fix_recursive_print branch from c6a6c07 to 051cec9 Compare October 12, 2019 00:47
These statements can potentially be called from within a logging
function, which causes a "recursive print" warning.

Signed-off-by: Michael Carroll <michael@openrobotics.org>
@mjcarroll mjcarroll force-pushed the fix_recursive_print branch from 051cec9 to ae35b6c Compare October 12, 2019 00:48
@flixr
Copy link
Contributor

flixr commented Jan 12, 2020

These debug messages can be useful sometimes, but while I personally prefer #1597 this is also acceptable to me.
The current state makes debugging impossible though and we really need to fix this one way or another!

@dirk-thomas
Copy link
Member

@ros-pull-request-builder retest this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants