Multi-line strings with indentation as input to C++ logging macros
How can I input a multi-line string to one of the C++ logging functions and have it properly ignore the white space? Here's an example:
ROS_INFO("Cost error: %d = \
(Current: %u - Initial: %u)",
error_cost, cost, cost_init);
What ends up being printed is a single line (desirable) but with a bunch of spaces (undesirable):
Cost error: 0 = (Current: 88 - Initial: 88)
Reading this ( http://stackoverflow.com/a/1135862/26... ) I realized that the backslash takes care of the new line but not the indentation. Is there a better way? (I'd rather not define the string beforehand and then pass a variable to ROS_INFO
if I can avoid it.)