lagom.util.logging.NullLogger.info()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 4
dl 0
loc 2
rs 10
c 0
b 0
f 0
ccs 1
cts 2
cp 0.5
crap 1.125
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