def get_observer(settings):
 def observer(msg):
  u'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[u'line'] + settings[u'add_ln']) if (u'line' in msg) else 0)
  out = u'[{source}{colon}{line}] {text}'.format(source=settings[u'source'], colon=(u':' if line else u''), line=line, text=text)
  settings[u'logger'].log(errormap[msg[u'level']], out)
 return observer

def get_observer ( settings ) : def observer ( msg ) : errormap = { 0 : 1 , 1 : 2 , 2 : 4 , 3 : 5 , 4 : 6 } text = docutils . nodes . Element . astext ( msg ) line = ( ( msg [ u'line' ] + settings [ u'add_ln' ] ) if ( u'line' in msg ) else 0 ) out = u'[{source}{colon}{line}] {text}' . format ( source = settings [ u'source' ] , colon = ( u':' if line else u'' ) , line = line , text = text ) settings [ u'logger' ] . log ( errormap [ msg [ u'level' ] ] , out ) return observer
return an observer for the docutils reporter .