Instead of printfs or std::cout/cerr this code should be updated to use ROS_INFO/ROS_INFO_STREAM, ROS_WARN... ROS_ERROR, and so on.