Skip to content

Commit 54808fd

Browse files
committed
NullHandler python < 2.7
1 parent e7655a2 commit 54808fd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

resources/lib/twitch/logging.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33

44
import logging
55

6+
try:
7+
from logging import NullHandler
8+
except ImportError:
9+
class NullHandler(logging.Handler):
10+
def emit(self, record):
11+
pass
12+
613
log = logging.getLogger('twitch')
7-
log.addHandler(logging.NullHandler())
14+
log.addHandler(NullHandler())
815

916

1017
def deprecation_warning(logger, old, new):

0 commit comments

Comments
 (0)