Skip to content

Commit fbef3e4

Browse files
author
Juho Hovila
committed
Revert "Use get_log"
This reverts commit 82756be.
1 parent daa5939 commit fbef3e4

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

socketIO_client/heartbeats.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
from invisibleroads_macros.log import get_log
1+
import logging
22
from threading import Thread, Event
33

44
from .exceptions import ConnectionError, TimeoutError
55

66

7-
L = get_log(__name__)
8-
9-
107
class HeartbeatThread(Thread):
118

129
daemon = True
@@ -37,7 +34,7 @@ def run(self):
3734
if self._rest and hasattr(self._rest, 'wait'):
3835
self._rest.wait(interval_in_seconds)
3936
except ConnectionError:
40-
L.debug('[heartbeat connection error]')
37+
logging.debug('[heartbeat connection error]')
4138

4239
def relax(self):
4340
self._adrenaline.clear()

socketIO_client/logs.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
import logging
22
import time
3-
from invisibleroads_macros.log import get_log
43

4+
from .symmetries import NullHandler
55

6-
L = get_log('socketIO-client')
6+
7+
LOG = logging.getLogger('socketIO-client')
8+
LOG.addHandler(NullHandler())
79

810

911
class LoggingMixin(object):
1012

1113
def _log(self, level, msg, *attrs):
12-
L.log(level, '%s %s' % (self._log_name, msg), *attrs)
14+
LOG.log(level, '%s %s' % (self._log_name, msg), *attrs)
1315

1416
def _debug(self, msg, *attrs):
1517
self._log(logging.DEBUG, msg, *attrs)

socketIO_client/symmetries.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
try:
2+
from logging import NullHandler
3+
except ImportError: # Python 2.6
4+
from logging import Handler
5+
6+
class NullHandler(Handler):
7+
8+
def emit(self, record):
9+
pass
10+
11+
112
from six import indexbytes
213

314

0 commit comments

Comments
 (0)