def log_output(stream):
 for chunk in stream:
  logger.debug(chunk)
  if (u'"error"' in chunk.lower()):
   raise docker.errors.DockerException(chunk)

def log_output ( stream ) : for chunk in stream : logger . debug ( chunk ) if ( u'"error"' in chunk . lower ( ) ) : raise docker . errors . DockerException ( chunk )
log a stream at debug level .