Coverage for app/ddd/infrastructure/log/logger.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-15 01:44 +0000

1from logging import DEBUG, Formatter, StreamHandler, getLogger 

2 

3# import coloredlogs 

4 

5fmt = "%(asctime)s %(name)s:%(lineno)s %(funcName)s [%(levelname)s]: %(message)s" 

6handler_format = Formatter(fmt) 

7 

8stream_handler = StreamHandler() 

9stream_handler.setFormatter(handler_format) 

10 

11logger = getLogger("main") 

12logger.setLevel(DEBUG) 

13logger.addHandler(stream_handler) 

14 

15# coloredlogs.install( 

16# level='DEBUG', 

17# logger=logger, 

18# fmt=fmt, 

19# # datefmt='%Y/%m/%d %H:%M:%S' 

20# )