예제 #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)
예제 #2
0
 def start_logging(self):
     super(IPEngineApp, self).start_logging()
     if self.master_config.Global.log_url:
         context = self.engine.context
         lsock = context.socket(zmq.PUB)
         lsock.connect(self.master_config.Global.log_url)
         handler = EnginePUBHandler(self.engine, lsock)
         handler.setLevel(self.log_level)
         self.log.addHandler(handler)
예제 #3
0
 def start_logging(self):
     super(IPEngineApp, self).start_logging()
     if self.master_config.Global.log_url:
         context = self.engine.context
         lsock = context.socket(zmq.PUB)
         lsock.connect(self.master_config.Global.log_url)
         handler = EnginePUBHandler(self.engine, lsock)
         handler.setLevel(self.log_level)
         self.log.addHandler(handler)
예제 #4
0
파일: util.py 프로젝트: vvatsa/ipython
def connect_engine_logger(context, iface, engine, loglevel=logging.DEBUG):
    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)
예제 #5
0
def connect_engine_logger(context, iface, engine, loglevel=logging.DEBUG):
    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)