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

ErrorStorage.__init__()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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