Skip to content
This repository has been archived by the owner on Nov 13, 2017. It is now read-only.

Fix truncated debug message #210

Merged
merged 1 commit into from
Nov 26, 2014
Merged

Fix truncated debug message #210

merged 1 commit into from
Nov 26, 2014

Conversation

davetcoleman
Copy link
Member

There is a bug that does not allow an entire robot model to be printed to debug logging because of a 1024 byte limit on the message:

https://github.com/ros/console_bridge/blob/master/src/console.cpp#L75

Instead you only get a truncated version of the model info. As a workaround I thought we could possibly use std::cout and surround it with NDEBUG as discussed in ros-infrastructure/bloom#327 (comment)

My fix here probably isn't right though, I welcome corrections and feedback. Thanks!

@isucan
Copy link
Contributor

isucan commented Nov 25, 2014

This is very sucky indeed. We can do this as a temp hack, but we should make that 1024 larger maybe? 4k?

@davetcoleman
Copy link
Member Author

That would require all calls to logX() on console_bridge allocate 4x more memory though, right? I've never seen any other debug output exceed that limit, so it seems it would be very wasteful.

What would be even better is if console_birdge provided a string input or a stringstream.

But that is a lot of effort. What if I remove the compile flags and surround the printModelInfo() with if (false) so that it is never actually outputted but is still preserved for future debugging?

@isucan
Copy link
Contributor

isucan commented Nov 25, 2014

the (false) thing sounds good to me

@davetcoleman
Copy link
Member Author

Updated and squashed

@mikeferguson
Copy link
Contributor

Sweet and now I can turn it on with:

 #define false true

isucan added a commit that referenced this pull request Nov 26, 2014
@isucan isucan merged commit 03d92cc into moveit:indigo-devel Nov 26, 2014
@davetcoleman davetcoleman deleted the debug_model branch November 26, 2014 01:39
@davetcoleman
Copy link
Member Author

giphy

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

Successfully merging this pull request may close these issues.

None yet

3 participants