#NEWLINE# def connect_engine_logger( context , iface , engine , loglevel = logging . DEBUG ) : #NEWLINE# #INDENT# logger = logging . getLogger ( ) #NEWLINE# if any ( [ isinstance ( h , handlers . PUBHandler ) for h in logger . handlers ] ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# loglevel = integer_loglevel ( loglevel ) #NEWLINE# lsock = context . socket ( zmq . PUB ) #NEWLINE# lsock . connect ( iface ) #NEWLINE# handler = EnginePUBHandler ( engine , lsock ) #NEWLINE# handler . setLevel ( loglevel ) #NEWLINE# logger . addHandler ( handler ) #NEWLINE# logger . setLevel ( loglevel ) #NEWLINE# return logger