cliutil: Set floor for pdfminer loglevel.

This commit is contained in:
Brett Smith 2021-01-09 10:09:45 -05:00
parent 2cf4fdcfad
commit b074edc538

View file

@ -376,10 +376,11 @@ def set_loglevel(logger: logging.Logger, loglevel: int=logging.INFO) -> None:
"""
if '.' not in logger.name:
logger = logging.getLogger()
if loglevel <= logging.DEBUG:
# At the debug level, the rt module logs the full body of every
# request and response. That's too much.
logging.getLogger('rt.rt').setLevel(logging.INFO)
# pdfminer logs debug-like messages at the info level
logging.getLogger('pdfminer').setLevel(max(loglevel, logging.WARNING))
# At the debug level, the rt module logs the full body of every
# request and response. That's too much.
logging.getLogger('rt.rt').setLevel(max(loglevel, logging.INFO))
logger.setLevel(loglevel)
def bytes_output(path: Optional[Path]=None,