def recordToMessage(record, reqid):
    """
    Format a log record as a list of interesting entries (a message) for the
    daemon-client protocol.
    """

    msg = [getattr(record, e) for e in ('name', 'created', 'levelno',
                                        'message', 'exc_text')] + [reqid]
    if not hasattr(record, 'nonl'):
        msg[3] += '\n'
    return msg