From this question: Redirecting function output to /dev/null I have tried to employ the following code:
std::ofstream catchPCLStream("/dev/null");
std::streambuf *originalOutputBuffer = std::cout.rdbuf();
std::cout.rdbuf(catchPCLStream.rdbuf());
std::cerr.rdbuf(catchPCLStream.rdbuf());
icp_.align(dataCloudTransformedByIcp_, icpInternalUpdatePose_);
std::cout.rdbuf(originalOutputBuffer);
std::cerr.rdbuf(originalOutputBuffer);
But I still get a huge amount of output from the registration library:
[pcl::IterativeClosestPoint::computeTransformation] Not enough correspondences found. Relax your threshold parameters.
Is there something different about this output that stops it from being caught by this? Is it not going to cout
or cerr
?
std::cout.rdbuf(0);
before calling your function? – Kwiatkowskistd::cout.rdbuf(0/Null/nullptr)
– Pilgrimagestd::cerr.rdbuf(0);
– Kwiatkowskipcl/Exception.h
– PilgrimageException.h
anywhere? – PerplexDisableConsoleOutput
appears anywhere in my pcl include files. Maybe it has been replaced? I also cant access the pcl website for some reason atm – Pilgrimage#include <pcl/io/io_exception.h>
– Perplex