Passed
Push — develop ( e15ceb...5f9839 )
by Dean
02:51
created

ErrorStorage   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
dl 0
loc 15
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A emit() 0 11 3
A __init__() 0 2 1
1
from plugin.managers.exception import ExceptionManager
2
import logging
3
4
log = logging.getLogger(__name__)
5
6
7
class ErrorStorage(logging.Handler):
8
    def __init__(self):
9
        super(ErrorStorage, self).__init__()
10
11
    def emit(self, record):
12
        if record.levelno < logging.ERROR:
13
            return
14
15
        if record.exc_info:
16
            ExceptionManager.create.from_exc_info(record.exc_info)
17
            return
18
19
        self.format(record)
20
21
        ExceptionManager.create.from_message(record.message)
0 ignored issues
show
Bug introduced by
It seems like a value for argument message is missing in the unbound method call.
Loading history...
22
23
ERROR_STORAGE_HANDLER = ErrorStorage()
24