Test Failed
Push — beta ( c9094c...317f5f )
by Dean
03:05
created

log_unsupported_guid()   A

Complexity

Conditions 3

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
rs 9.4285
cc 3
1
from plex_metadata import Guid
2
3
4
def log_unsupported_guid(logger, guid):
5
    if guid and isinstance(guid, Guid):
6
        logger.warn('Unsupported guid: %%r (agent: %r)' % guid.agent_id, guid.value, extra={
7
            'original': guid.original,
8
            'event': {
9
                'module': __name__,
10
                'name': 'unsupported_guid',
11
                'key': (guid.agent_id, guid.value)
12
            }
13
        })
14
    else:
15
        logger.warn('Unsupported guid: %r', guid, extra={
16
            'event': {
17
                'module': __name__,
18
                'name': 'unsupported_guid',
19
                'key': guid
20
            }
21
        })
22