def METHOD_NAME(self, record, inlined=False):
    filename, line, column, function, address = record
    stub_globals = {"__name__": filename, "__loader__": source_loader}
    source_line = linecache.getline(filename, line, stub_globals)
    indentation = re.search(r"^\s*", source_line).end()
    if address is None:
        formatted_address = ""
    elif inlined:
        formatted_address = " (inlined)"
    else:
        formatted_address = " (RA=+0x{:x})".format(address)
    filename = filename.replace(artiq_dir, "<artiq>")
    lines = []
    if column == -1:
        lines.append("    {}".format(source_line.strip() if source_line else "<unknown>"))
        lines.append("  File \"{file}\", line {line}, in {function}{address}".
                     format(file=filename, line=line, function=function,
                            address=formatted_address))
    else:
        lines.append("    {}^".format(" " * (column - indentation)))
        lines.append("    {}".format(source_line.strip() if source_line else "<unknown>"))
        lines.append("  File \"{file}\", line {line}, column {column},"
                     " in {function}{address}".
                     format(file=filename, line=line, column=column + 1,
                            function=function, address=formatted_address))
    return lines