Ejemplo n.º 1
0
 def forward_logging(self):
     if self.log_url:
         self.log.info("Forwarding logging to %s", self.log_url)
         context = self.engine.context
         lsock = context.socket(zmq.PUB)
         lsock.connect(self.log_url)
         handler = EnginePUBHandler(self.engine, lsock)
         handler.setLevel(self.log_level)
         self.log.addHandler(handler)
Ejemplo n.º 2
0
 def forward_logging(self):
     if self.log_url:
         self.log.info("Forwarding logging to %s", self.log_url)
         context = self.engine.context
         lsock = context.socket(zmq.PUB)
         lsock.connect(self.log_url)
         handler = EnginePUBHandler(self.engine, lsock)
         handler.setLevel(self.log_level)
         self.log.addHandler(handler)
Ejemplo n.º 3
0
def connect_engine_logger(context, iface, engine, loglevel=logging.DEBUG):
    from ipyparallel.engine.log import EnginePUBHandler
    
    logger = logging.getLogger()
    if any([isinstance(h, handlers.PUBHandler) for h in logger.handlers]):
        # don't add a second PUBHandler
        return
    loglevel = integer_loglevel(loglevel)
    lsock = context.socket(zmq.PUB)
    lsock.connect(iface)
    handler = EnginePUBHandler(engine, lsock)
    handler.setLevel(loglevel)
    logger.addHandler(handler)
    logger.setLevel(loglevel)
    return logger
Ejemplo n.º 4
0
def connect_engine_logger(context, iface, engine, loglevel=logging.DEBUG):
    from ipyparallel.engine.log import EnginePUBHandler
    
    logger = logging.getLogger()
    if any([isinstance(h, handlers.PUBHandler) for h in logger.handlers]):
        # don't add a second PUBHandler
        return
    loglevel = integer_loglevel(loglevel)
    lsock = context.socket(zmq.PUB)
    lsock.connect(iface)
    handler = EnginePUBHandler(engine, lsock)
    handler.setLevel(loglevel)
    logger.addHandler(handler)
    logger.setLevel(loglevel)
    return logger