Update ApplicationInsightsHandler.py

Minor changes to make inheritance work better on both Python 2.x and 3.x.
This commit is contained in:
Steve Dower 2015-01-02 18:19:21 -08:00
Родитель 5b7b01b2ec
Коммит 5eaae6502e
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -19,13 +19,13 @@ class ApplicationInsightsHandler(logging.Handler):
raise Exception('Instrumentation key was required but not provided')
self.client = applicationinsights.TelemetryClient()
self.client.context.instrumentation_key = instrumentation_key
logging.Handler.__init__(self, *args, **kwargs)
super(ApplicationInsightsHandler, self).__init__(*args, **kwargs)
def flush(self):
"""Flushes the queued up telemetry to the service.
"""
self.client.flush()
return super().flush()
return super(ApplicationInsightsHandler, self).flush()
def emit(self, record):
"""Emit a record.