I am wrapping a C/C++ library in a Rust crate and calling into it using FFI (I am not using a subprocess).
This library logs to stdout/stderr (using, say, printf() or std::cout) but I would like to "catch" this output and use Rust's log crate to control the output.
Is it possible to redirect stdout/stderr of FFI calls to log?