Coverage for src/dirschema/log.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-12-07 09:34 +0000

1"""Setup of logging for dirschema.""" 

2 

3import logging 

4import sys 

5 

6logger = logging.getLogger("dirschema") 

7ch = logging.StreamHandler(sys.stderr) 

8formatter = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s") 

9 

10ch.setFormatter(formatter) 

11logger.addHandler(ch) 

12 

13log_level = {0: logging.ERROR, 1: logging.WARNING, 2: logging.INFO, 3: logging.DEBUG}