Exemple #1
0
def main():
    tornado.options.parse_command_line()
    if options.logfile:
        logging.basicConfig(filename=options.logfile, level=logging.DEBUG)

    if not os.path.isdir(options.jdir):
        logging.error('Log directory %s does not exist.' % options.jdir)
        sys.exit(1)
    server = Server(options.jdir, options.reliable)
    server.start(options.host, options.port)
    task.run_all(server)
    ioloop.IOLoop.instance().start()
Exemple #2
0
def main():
    tornado.options.parse_command_line()
    if options.logfile:
        logging.basicConfig(filename=options.logfile, level=logging.DEBUG)

    if not os.path.isdir(options.jdir):
        logging.error("Log directory %s does not exist." % options.jdir)
        sys.exit(1)
    server = Server(options.jdir, options.reliable)
    server.start(options.host, options.port)
    task.run_all(server)
    ioloop.IOLoop.instance().start()
Exemple #3
0
def main():
    tornado.options.parse_command_line()
    if options.logfile:
        logging.basicConfig(filename=options.logfile, level=logging.DEBUG)

    if not os.path.isdir(options.jdir):
        logging.error('Log directory %s does not exist.' % options.jdir)
        sys.exit(1)
    server = Server(options.jdir, options.reliable)

    if options.ws_port:
        ws_server = ws.Server()
        ws_server.listen(options.ws_port)

    server.start(options.host, options.port)

    if options.geoip_token:
        gt = geoip.GeoipTask(server, options.geoip_token)
        gt.watch()

    task.run_all(server)
    ioloop.IOLoop.instance().start()