Skip to content

Commit

Permalink
Merge pull request #850 from xsuchy/pull-req-bz866323
Browse files Browse the repository at this point in the history
866323 - do not print binary files to log
  • Loading branch information
xsuchy committed Oct 15, 2012
2 parents 1f3ca92 + c749d42 commit a6ef208
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cli/src/katello/client/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import kerberos
from kerberos import GSSError
import httplib
import logging
import os
import urllib
import mimetypes
Expand Down Expand Up @@ -286,8 +287,12 @@ def _process_response(self, response):
else:
pass

if response_body:
self._log.debug("processing response %s\n%s" % (response.status, u_str(response_body)))
if response_body and self._log.isEnabledFor(logging.DEBUG):
content_type = response.getheader('content-type')
if content_type and (content_type.startswith('text/') or content_type.startswith('application/json')):
self._log.debug("processing response %s\n%s" % (response.status, u_str(response_body)))
else:
self._log.debug("processing response %s of %s" % (response.status, content_type))
else:
self._log.debug("processing empty response %s" % (response.status))

Expand Down

0 comments on commit a6ef208

Please sign in to comment.