cliutil: Set floor for pdfminer loglevel.
This commit is contained in:
parent
2cf4fdcfad
commit
b074edc538
1 changed files with 5 additions and 4 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue