From 34b9be4efa40ffe6bf6c31b6d2248914d0b47262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 31 May 2017 11:03:04 +0200 Subject: [PATCH] Don't use str.format() when logging. The correct way to log is to use %-formatting, and pass the format args to the logging function. This prevents the string from being formatted at all when the log item isn't logged anywhere (in this case, when the log level is WARNING or higher). --- pillar/cli/operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pillar/cli/operations.py b/pillar/cli/operations.py index 3ced5ced..64326a9f 100644 --- a/pillar/cli/operations.py +++ b/pillar/cli/operations.py @@ -132,7 +132,7 @@ def index_users_rebuild(): users_index = current_app.algolia_index_users - log.info('Dropping index: {}'.format(users_index)) + log.info('Dropping existing index: %s', users_index) users_index.clear_index() index_users_update_settings()