def update_handler_level(logger, handler_type, level='INFO'):
    for handler in (logger.handlers or logger.parent.handlers):
        if isinstance(handler, handler_type):
            print(handler.level)
handler.setLevel(getattr(logging, level, 'INFO'))
print(handler.level)
mylogger.debug('test')
update_handler_level(mylogger, logging.StreamHandler)
mylogger.debug('test')
Python logging to multiple handlers, at different log levels?