Skip to content

Commit 032a1aa

Browse files
committed
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.
1 parent 9f9dc21 commit 032a1aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

elasticsearch/connection/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
# logger hasn't already been configured
1313
_tracer_already_configured = 'elasticsearch.trace' in logging.Logger.manager.loggerDict
1414
tracer = logging.getLogger('elasticsearch.trace')
15-
tracer.propagate = not _tracer_already_configured
15+
if not _tracer_already_configured:
16+
tracer.propagate = False
1617

1718

1819
class Connection(object):

0 commit comments

Comments
 (0)