d-k-bo/python-makemkv

Option to redirect/surpress stderr

gregersn opened this issue · 2 comments

makemkvcon spits out a lot of error messages, I am guessing this is because Popen send them to stdout,
could it be possible to have some way of redirecting this so they either can be handled with a callback, or just surpress them?

A lot of it is just status that can't be done a lot with.

python-makemkv uses python's logging module. You can use logging.basicConfig() to change logging settings like log format, log level (debug, info, warning, error, critical) or log handlers.
To suppress warnings from makemkv, you can also set the log level of makemkv's Logger to "error"

import logging

logging.getLogger("makemkv").setLevel(logging.ERROR)

or suppress all messages

logging.getLogger("makemkv").setLevel(logging.CRITICAL)

If you think that the log level of a specific message isn't appropriate (there are ~300 different messages, I have not yet met most of them in a real life situation), feel free to point me to its id (the number in parentheses) and I can take a look at it.

Thank you!
Works just like I wanted. Closing the issue, and will report if any specific message causes a problem.