def METHOD_NAME(self, record):
    if record.level == Level.ERROR:
        bg = "background-color:red;"
    elif record.level == Level.WARNING:
        bg = "background-color:orange;"
    elif record.level == Level.INFO:
        bg = "background-color:lime;"
    else:
        bg = ""
    if record.channel == Channel.STDOUT:
        ch = ""
    elif record.channel == Channel.STDERR:
        ch = "font-style: italic;"
    else:
        ch = "font-weight: bold;"
    data = "<span style=\"{}{}\">{}</span>".format(bg, ch, record.data)
    self.console_textedit.append(data)