| Total Complexity | 7 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Coverage | 52.63% |
| Changes | 0 | ||
| 1 | """ |
||
| 2 | Help with logging within lagom |
||
| 3 | """ |
||
| 4 | |||
| 5 | 1 | from typing import TYPE_CHECKING |
|
| 6 | |||
| 7 | 1 | if TYPE_CHECKING: |
|
| 8 | from logging import Logger |
||
| 9 | |||
| 10 | class NullLogger(Logger): |
||
| 11 | """ |
||
| 12 | The NullLogger should type exactly as a regular logger |
||
| 13 | """ |
||
| 14 | |||
| 15 | def __init__(self): |
||
| 16 | pass |
||
| 17 | |||
| 18 | else: |
||
| 19 | |||
| 20 | 1 | class NullLogger: |
|
| 21 | """ |
||
| 22 | Implements the contract of a logger but does nothing |
||
| 23 | """ |
||
| 24 | |||
| 25 | 1 | def debug(self, msg, *args, **kwargs): |
|
| 26 | pass |
||
| 27 | |||
| 28 | 1 | def info(self, msg, *args, **kwargs): |
|
| 29 | pass |
||
| 30 | |||
| 31 | 1 | def warning(self, msg, *args, **kwargs): |
|
| 32 | 1 | pass |
|
| 33 | |||
| 34 | 1 | def error(self, msg, *args, **kwargs): |
|
| 35 | pass |
||
| 36 | |||
| 37 | 1 | def exception(self, msg, *args, exc_info=True, **kwargs): |
|
| 38 | pass |
||
| 39 | |||
| 40 | 1 | def critical(self, msg, *args, **kwargs): |
|
| 41 | pass |
||
| 42 |