'Provide an easy, safe, systematic way of handling Debug output
(stdout/stderr are normally redirected within tests)'

def s3_debug(self, message, value=None):

    stderr_redirector = sys.stderr
    sys.stderr = self._resultForDoCleanups.stderr0
    output = s3_unicode(message)
    if value:
        output = ('%s:    %s' % (output, s3_unicode(value)))
    try:
        print >>sys.stderr, output
    except:
        print >>sys.stderr, 'Debug    crashed'
    sys.stderr = stderr_redirector
