def METHOD_NAME(self, message, type):
    """This writes both status and output messages to the log.
    For output messages also the correct encoding is re-applied:
    LilyPond writes filenames out in the system's filesystemencoding,
    while the messages are always written in UTF-8 encoding...
    """
    if type == job.STDERR:
        # find filenames in message:
        #TODO: make the various encoding parameters be read directly
        # from the Job.
        # But this should be reviewed in general anyway.
        parts = iter(errors.message_re.split(message.encode('utf-8')))
        msg = next(parts).decode('utf-8', 'replace')
        self.cursor.insertText(msg, self.textFormat(type))
        enc = sys.getfilesystemencoding()
        for url, path, line, col, msg in zip(*itertools.repeat(parts, 5)):
            url = url.decode(enc)
            path = path.decode(enc)
            msg = msg.decode('utf-8', 'replace')
            if self._rawView:
                fmt = QTextCharFormat(self.textFormat(type))
                display_url = url
            else:
                fmt = QTextCharFormat(self.textFormat("link"))
                display_url = os.path.basename(path)
            fmt.setAnchor(True)
            fmt.setAnchorHref(str(len(self._errors)))
            fmt.setToolTip(_("Click to edit this file"))
            pos = self.cursor.position()
            self.cursor.insertText(display_url, fmt)
            self.cursor.insertText(msg, self.textFormat(type))
            self._errors.append((pos, self.cursor.position(), url))
    else:
        super().METHOD_NAME(message, type)