Fixes issue introduced in 482f166 where the tracer spams when

unconfigured.

In the aforementioned commit, the existing behavior was changed,
I believe in advertantly, to set propagate to False if the
trace logger already has been configured. This seems to be the
opposite of the internet, and this change restores what appears
to have been the intent, and silences the tracer unless
it has been configured, in which case it will propagate.
This commit is contained in:
Jim Kelly
2015-04-28 22:32:57 +02:00
parent 9f9dc210f4
commit 032a1aa799
+2 -1
View File
@@ -12,7 +12,8 @@ logger = logging.getLogger('elasticsearch')
# logger hasn't already been configured
_tracer_already_configured = 'elasticsearch.trace' in logging.Logger.manager.loggerDict
tracer = logging.getLogger('elasticsearch.trace')
tracer.propagate = not _tracer_already_configured
if not _tracer_already_configured:
tracer.propagate = False
class Connection(object):