From 0328b2244b25df80ecd1ebdd270d42c01cc7bcc1 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Wed, 11 May 2011 08:43:03 +0200 Subject: [PATCH] Use the internal decoder to log requests --- radicale/__init__.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index b7e1a79..fd7a772 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -186,12 +186,8 @@ class Application(object): # Set content length if answer: - if isinstance(answer, str): - log_answer = answer - else: - # Decode the answer for logging purposes on Python 3 - log_answer = answer.decode(config.get("encoding", "request")) - log.LOGGER.debug("Response content:\n%s" % log_answer) + log.LOGGER.debug( + "Response content:\n%s" % self.decode(answer, environ)) headers["Content-Length"] = str(len(answer)) # Start response