Skip to content

Commit eea7e15

Browse files
author
Nisan Haramati
committed
Add NullHandler for py 2.6
1 parent c274d04 commit eea7e15

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

riemann_client/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
from __future__ import absolute_import
88

99
import logging
10+
try:
11+
from logging import NullHandler
12+
except ImportError:
13+
# Create a NullHandler class in logging for python 2.6
14+
class NullHandler(logging.Handler):
15+
def emit(self, record):
16+
pass
17+
1018
import socket
1119
try:
1220
from threading import RLock
@@ -21,6 +29,7 @@
2129

2230

2331
logger = logging.getLogger(__name__)
32+
logger.addHandler(NullHandler())
2433

2534

2635
class Client(object):

0 commit comments

Comments
 (0)