From 032a1aa799e6a1ac1caa5844982021229927217c Mon Sep 17 00:00:00 2001 From: Jim Kelly Date: Tue, 28 Apr 2015 22:32:57 +0200 Subject: [PATCH] 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. --- elasticsearch/connection/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elasticsearch/connection/base.py b/elasticsearch/connection/base.py index 5d254555..e1cb5503 100644 --- a/elasticsearch/connection/base.py +++ b/elasticsearch/connection/base.py @@ -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):