If they are really outputting through std::cout and std::cerr then you could replace those object's stream buffers, but you would have to redirect your own program's output through other streams. See this question for how to do this.
However, if they use std::printf() etc. then this won't work.