Skip to content

Commit 352926d

Browse files
authored
Log cleanup (#91)
* Ensure all loggers have __name__ defined * Bump version to 0.12.2
1 parent 90d4f11 commit 352926d

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

insteonplm/devices/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class Device(object):
8080
def __init__(self, plm, address, cat, subcat, product_key=0x00,
8181
description='', model=''):
8282
"""Initialize the Device class."""
83-
self.log = logging.getLogger()
83+
self.log = logging.getLogger(__name__)
8484

8585
self._plm = plm
8686

@@ -642,7 +642,7 @@ def __init__(self, plm, housecode, unitcode):
642642
self._message_callbacks = MessageCallback()
643643
self._stateList = StateList()
644644
self._send_msg_lock = asyncio.Lock(loop=self._plm.loop)
645-
self.log = logging.getLogger()
645+
self.log = logging.getLogger(__name__)
646646

647647
@property
648648
def address(self):
@@ -894,7 +894,7 @@ def __init__(self, in_use, controller, used_before, bit5=0, bit4=0):
894894
self._used_before = bool(used_before)
895895
self._bit5 = bool(bit5)
896896
self._bit4 = bool(bit4)
897-
self.log = logging.getLogger()
897+
self.log = logging.getLogger(__name__)
898898

899899
@property
900900
def is_in_use(self):

insteonplm/states/x10.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
X10_COMMAND_BRIGHT)
1414

1515

16-
_LOGGER = logging.getLogger()
16+
_LOGGER = logging.getLogger(__name__)
1717

1818

1919
class X10OnOffSwitch(State):

insteonplm/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from insteonplm.devices import Device, ALDBStatus
1212

1313
__all__ = ('Tools', 'monitor', 'interactive')
14-
_LOGGING = logging.getLogger()
14+
_LOGGING = logging.getLogger(__name__)
1515
PROMPT = 'insteonplm: '
1616
INTRO = ('INSTEON PLM interactive command processor.\n'
1717
'Type `help` for a list of commands.\n\n'

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
setup(
1616
name='insteonplm',
17-
version='0.12.1',
17+
version='0.12.2',
1818
author='David McNett',
1919
author_email='[email protected]',
2020
url='https://github.com/nugget/python-insteonplm',

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Tests for insteonplm module."""
22
import logging
3-
_LOGGER = logging.getLogger()
3+
_LOGGER = logging.getLogger(__name__)

tests/mockConnection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import logging
77

88

9-
_LOGGER = logging.getLogger()
9+
_LOGGER = logging.getLogger(__name__)
1010

1111

1212
@asyncio.coroutine

tests/mockPLM.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class MockPLM(object):
1010

1111
def __init__(self, loop=None):
1212
"""Initialize the MockPLM class."""
13-
self.log = logging.getLogger()
13+
self.log = logging.getLogger(__name__)
1414
self.sentmessage = ''
1515
self._message_callbacks = MessageCallback()
1616
self.loop = loop

tests/test_plm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from .mockConnection import MockConnection, wait_for_plm_command
2828
from .mockCallbacks import MockCallbacks
2929

30-
_LOGGER = logging.getLogger()
30+
_LOGGER = logging.getLogger(__name__)
3131
_INSTEON_LOGGER = logging.getLogger('insteonplm')
3232
_INSTEON_LOGGER.setLevel(logging.DEBUG)
3333
SEND_MSG_WAIT = 1.1

tests/test_switchedLightingControl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from .mockCallbacks import MockCallbacks
1919

2020
import logging
21-
_LOGGING = logging.getLogger()
21+
_LOGGING = logging.getLogger(__name__)
2222
_LOGGING.setLevel(logging.DEBUG)
2323

2424
def test_switchedLightingControl():

tests/test_x10.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from .mockPLM import MockPLM
2222

2323

24-
_LOGGER = logging.getLogger()
24+
_LOGGER = logging.getLogger(__name__)
2525

2626

2727
def test_x10OnOff():

0 commit comments

Comments
 (0)