Use the internal decoder to log requests

This commit is contained in:
Guillaume Ayoub 2011-05-11 08:43:03 +02:00
parent 3b17ed2969
commit 0328b2244b

View File

@ -186,12 +186,8 @@ class Application(object):
# Set content length # Set content length
if answer: if answer:
if isinstance(answer, str): log.LOGGER.debug(
log_answer = answer "Response content:\n%s" % self.decode(answer, environ))
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)
headers["Content-Length"] = str(len(answer)) headers["Content-Length"] = str(len(answer))
# Start response # Start response