Skip to content

Commit 9cb2f8e

Browse files
authored
Merge pull request #6 from liampauling/master
spelling errors / py3 compatibility on tests
2 parents 88e39e3 + b28c99c commit 9cb2f8e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmreshandler/cmreshandler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AuthType(Enum):
3030
BASIC_AUTH = 1
3131
KERBEROS_AUTH = 2
3232

33-
# Defauls for the class
33+
# Defaults for the class
3434
__DEFAULT_HOST = [{'host': 'localhost', 'port': 9200}]
3535
__DEFAULT_AUTH_USER = ''
3636
__DEFAULT_AUTH_PASSWD = ''
@@ -97,8 +97,8 @@ def __init__(self,
9797
self.flush_frequency_in_sec = flush_frequency_in_sec
9898
self.es_index_name = es_index_name
9999
self.es_doc_type = es_doc_type
100-
self.es_additional_fileds = es_additional_fields.copy()
101-
self.es_additional_fileds.update({'host': socket.gethostname(),
100+
self.es_additional_fields = es_additional_fields.copy()
101+
self.es_additional_fields.update({'host': socket.gethostname(),
102102
'host_ip': socket.gethostbyname(socket.gethostname())})
103103
self.raise_on_indexing_exceptions = raise_on_indexing_exceptions
104104

@@ -199,7 +199,7 @@ def emit(self, record):
199199
:param record: A class of type ```logging.LogRecord```
200200
:return: None
201201
"""
202-
rec = self.es_additional_fileds.copy()
202+
rec = self.es_additional_fields.copy()
203203
for k, v in record.__dict__.items():
204204
if k not in CMRESHandler.__LOGGING_FILTER_FIELDS:
205205
rec[k] = "" if v is None else v

tests/test_cmreshandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def test_fast_insertion_of_thousands_logs(self):
102102
log = logging.getLogger("PythonTest")
103103
log.setLevel(logging.DEBUG)
104104
log.addHandler(handler)
105-
for i in xrange(1000):
105+
for i in range(1000):
106106
log.info("Logging line {0:d}".format(i), extra={'LineNum': i})
107107
time.sleep(0.5)
108108
self.assertEquals(0, len(handler._buffer))

0 commit comments

Comments
 (0)