human
Complete this python program:
def get_observer(settings):
assistant
#Here is the Python program you requested.

    """Return an observer for the docutils Reporter.
    """
    def observer(msg):
        'Report    docutils/rest    messages    to    a    Nikola    user.\n\n                                Error    code    mapping:\n\n                                +------+---------+------+----------+\n                                |    dNUM    |            dNAME    |    lNUM    |                lNAME    |                d    =    docutils,    l    =    logbook\n                                +------+---------+------+----------+\n                                |                0    |            DEBUG    |                1    |                DEBUG    |\n                                |                1    |                INFO    |                2    |                    INFO    |\n                                |                2    |    WARNING    |                4    |        WARNING    |\n                                |                3    |            ERROR    |                5    |                ERROR    |\n                                |                4    |        SEVERE    |                6    |    CRITICAL    |\n                                +------+---------+------+----------+\n                                '
        errormap = {0: 1, 1: 2, 2: 4, 3: 5, 4: 6}
        text = docutils.nodes.Element.astext(msg)
        line = ((msg['line'] + settings['add_ln']) if ('line' in msg) else 0)
        out = '[{source}{colon}{line}]    {text}'.format(source=settings['source'], colon=(':' if line else ''), line=line, text=text)
        settings['logger'].log(errormap[msg['level']], out)
    return observer