Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/wheel/_setuptools_logging.py: 92%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

12 statements  

1# copied from setuptools.logging, omitting monkeypatching 

2from __future__ import annotations 

3 

4import logging 

5import sys 

6 

7 

8def _not_warning(record: logging.LogRecord) -> bool: 

9 return record.levelno < logging.WARNING 

10 

11 

12def configure() -> None: 

13 """ 

14 Configure logging to emit warning and above to stderr 

15 and everything else to stdout. This behavior is provided 

16 for compatibility with distutils.log but may change in 

17 the future. 

18 """ 

19 err_handler = logging.StreamHandler() 

20 err_handler.setLevel(logging.WARNING) 

21 out_handler = logging.StreamHandler(sys.stdout) 

22 out_handler.addFilter(_not_warning) 

23 handlers = err_handler, out_handler 

24 logging.basicConfig( 

25 format="{message}", style="{", handlers=handlers, level=logging.DEBUG 

26 )