How can I disable some logging messages in python?

Some logging message in request library in python are annoying.

I don’t want to disable all, but only some messages. How can I implement this code:

def show_message(log)
    if log.startswith("message"):
        return False
    return True

  • Are you trying to filter logging from a specific library or everything written to stdout/stderr?


  • @smallpepperz Just a specific library (requests). But if filtering anything in stdout/stderr is a way to do it. Both can work.


Leave a Comment