'Generate an event for the logging system with the given bytes as the
message.
This is called in a WSGI application thread, not the I/O thread.
@type data: str
@raise TypeError: On Python 3, if C{data} is not a native string. On
Python 2 a warning will be issued.'

def write(self, data):

    if (not isinstance(data, str)):
        if (str is bytes):
            warn(('write()    argument    should    be    str,    not    %r    (%s)' % (data, type(data).__name__)), category=UnicodeWarning)
        else:
            raise TypeError(('write()    argument    must    be    str,    not    %r    (%s)' % (data, type(data).__name__)))
    msg(data, system='wsgi', isError=True)
