How to add logging to a preprocessor?
Question
I currently try to write my own little preprocessor and want to add some logging to follow a long what is happening inside the preprocessor itself.
Right now I have the feeling that mdbook build crashes when adding any log output. This might be due to the fact that mdbook is listening for the processed book on stdin and therefor is interpreting my log messages written to stdin as ready processed book and fails.
So my question would be how to properly implement logging for a preprocessor?
I currently worked around it by writing to stderr, but I guess this is not the right way how it should be.
Thanks for the help
Version
mdbook v0.4.34
An environment variable RUST_LOG=debug seems to emit output that covers preprocessors as well (in part, at least).