Esempio n. 1
0
def main():
    logger = Logger("My Router")
    handler = StreamHandler(stdout)
    formatter = Formatter("%(asctime)s - %(name)s - %(levelname)s - " "%(message)s")
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    api_host_port = ("*", 5555)
    broadcast_host_port = ("*", 5556)
    default_config = {"store": {"monitoring filename": "/tmp/monitoring.log"}, "monitoring interval": 60}
    router = Router(api_host_port, broadcast_host_port, default_config, logger)
    router.start()
Esempio n. 2
0
def main():
    logger = Logger('Test Router')
    handler = StreamHandler(stdout)
    formatter = Formatter('%(asctime)s - %(name)s - %(levelname)s - '
                          '%(message)s')
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    api_host_port = ('*', 5555)
    broadcast_host_port = ('*', 5556)
    default_config = {'store': {'data': 'test'}, 'monitoring interval': 60, }
    router = Router(api_host_port, broadcast_host_port, default_config, logger)
    router.start()
Esempio n. 3
0
def main():
    logger = Logger('My Router')
    handler = StreamHandler(stdout)
    formatter = Formatter('%(asctime)s - %(name)s - %(levelname)s - '
                          '%(message)s')
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    api_host_port = ('*', 12345)
    broadcast_host_port = ('*', 12346)
    default_config = {'store': {'monitoring filename': '/tmp/monitoring.log'},
                      'monitoring interval': 60, }
    router = Router(api_host_port, broadcast_host_port, default_config, logger)
    router.start()
Esempio n. 4
0
def main():
    logger = Logger('Test Router')
    handler = StreamHandler(stdout)
    formatter = Formatter('%(asctime)s - %(name)s - %(levelname)s - '
                          '%(message)s')
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    api_host_port = ('*', 5555)
    broadcast_host_port = ('*', 5556)
    default_config = {
        'store': {
            'data': 'test'
        },
        'monitoring interval': 60,
    }
    router = Router(api_host_port, broadcast_host_port, default_config, logger)
    router.start()