summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/redis/client.py b/redis/client.py
index b02716e..81e977c 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -1438,10 +1438,11 @@ class Pipeline(Redis):
commands,
(('', ('EXEC',), ''),)
)])
- log.debug("MULTI")
- for command in commands:
- log.debug("TRANSACTION> "+ repr_command(command[1]))
- log.debug("EXEC")
+ if log.isEnabledFor(logging.DEBUG):
+ log.debug("MULTI")
+ for command in commands:
+ log.debug("TRANSACTION> "+ repr_command(command[1]))
+ log.debug("EXEC")
self.connection.send(all_cmds, self)
# parse off the response for MULTI and all commands prior to EXEC
for i in range(len(commands)+1):
@@ -1467,8 +1468,9 @@ class Pipeline(Redis):
def _execute_pipeline(self, commands):
# build up all commands into a single request to increase network perf
all_cmds = ''.join([self._encode_command(c) for _1, c, _2 in commands])
- for command in commands:
- log.debug("PIPELINE> " + repr_command(command[1]))
+ if log.isEnabledFor(logging.DEBUG):
+ for command in commands:
+ log.debug("PIPELINE> " + repr_command(command[1]))
self.connection.send(all_cmds, self)
data = []
for command_name, _, options in commands: