()
| 27 | |
| 28 | |
| 29 | def _setup_logger(): |
| 30 | _root_logger.setLevel(logging.DEBUG) |
| 31 | global _default_handler |
| 32 | if _default_handler is None: |
| 33 | _default_handler = logging.StreamHandler(sys.stdout) |
| 34 | _default_handler.flush = sys.stdout.flush # type: ignore |
| 35 | _default_handler.setLevel(logging.INFO) |
| 36 | _root_logger.addHandler(_default_handler) |
| 37 | fmt = NewLineFormatter(_FORMAT, datefmt=_DATE_FORMAT) |
| 38 | _default_handler.setFormatter(fmt) |
| 39 | # Setting this will avoid the message |
| 40 | # being propagated to the parent logger. |
| 41 | _root_logger.propagate = False |
| 42 | |
| 43 | |
| 44 | # The logger is initialized when the module is imported. |
no test coverage detected