Skip to content

Commit cc14efd

Browse files
committed
Only do tracer logging if there are handlers
Fixes elastic#391, thanks cp2587 for the report!
1 parent 6e94bf7 commit cc14efd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

elasticsearch/connection/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _pretty_json(data):
6565
logger.debug('> %s', body)
6666
logger.debug('< %s', response)
6767

68-
if tracer.isEnabledFor(logging.INFO):
68+
if tracer.isEnabledFor(logging.INFO) and tracer.hasHandlers():
6969
# include pretty in trace curls
7070
path = path.replace('?', '?pretty&', 1) if '?' in path else path + '?pretty'
7171
if self.url_prefix:

0 commit comments

Comments
 (0)