The only reason I am aware of this need is because it has caused performance problems in rviz’s point cloud rendering before:
https://github.com/ros-visualization/rviz/issues/775#issuecomment-59185412
It boiled down to an expensive debug statement inside the pointcloud rendering inner loop that was removed when compiling with -DNDEBUG
, which controlled whether or not debug logging statements were included.
Not exactly the same, but an example nonetheless of how the ability to not only remove the logging message but the work done to produce it was important as a compile time constraint.