Пример #1
0
        logging.basicConfig(level=logging.ERROR)
        logging.error("Logging is set to ERROR")
    elif args.verbose == 1:
        logging.basicConfig(level=logging.INFO)
        logging.info("Logging is set to INFO")
    elif args.verbose == 2:
        logging.basicConfig(level=logging.DEBUG)
        logging.debug("Logging is set to DEBUG")
    import cherrypy

    cherrypy.log.screen = False
    cherrypy.log.access_log.level = cherrypy.log.access_log.parent.level
    cherrypy.log.error_log.level = cherrypy.log.error_log.parent.level

    from archrepo.db_pool import buildPool
    from archrepo.repo import Processor
    from archrepo.web import ArchRepoWebServer

    pool = buildPool()
    p = Processor(pool=pool)
    p.serve()
    if p.serving:
        web_server = ArchRepoWebServer(pool)
        try:
            web_server.serve_forever()
        except KeyboardInterrupt:
            pass
        finally:
            p.kill()
    else:
        logging.critical("Another ArchRepo processor is working, try again later")