예제 #1
0
def main():
    base.set_logfocus(logfocus)
    logging.info("... done.")

    # just for debugging
    # if options["debug"]:
    #  logging.info(str(app.url_map))

    app.run(**configuration['flask_options'])
예제 #2
0
def main():
    base.set_logfocus(logfocus)
    logging.info("... done.")

    # just for debugging
    # if options["debug"]:
    #  logging.info(str(app.url_map))

    app.run(**configuration['flask_options'])
예제 #3
0
def main():
    set_logfocus(logfocus)
    logging.info("... done.")

    # just for debugging
    # if options["debug"]:
    #  logging.info(str(app.url_map))

    global configuration
    if not configuration:
        configuration = get_configuration()
    app.run(**configuration['flask_options'])
예제 #4
0
파일: website.py 프로젝트: jwbober/lmfdb
def main():
    set_logfocus(logfocus)
    logging.info("... done.")

    # just for debugging
    # if options["debug"]:
    #  logging.info(str(app.url_map))

    global configuration
    if not configuration:
        configuration = get_configuration()
    app.run(**configuration['flask_options'])
예제 #5
0
파일: website.py 프로젝트: swisherh/lmfdb
def main():
    set_logfocus(logfocus)
    logging.info("... done.")

    # just for debugging
    # if options["debug"]:
    #  logging.info(str(app.url_map))

    global configuration
    if not configuration:
        configuration = get_configuration()
    if "PROFILE" in configuration['flask_options'] and configuration['flask_options']["PROFILE"]:
        print "Profiling!"
        from werkzeug.contrib.profiler import ProfilerMiddleware
        app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions = [30], sort_by=('cumulative','time','calls'))
        del configuration['flask_options']["PROFILE"]

    app.run(**configuration['flask_options'])
예제 #6
0
def setup_logging():
    logging_options = Configuration().get_logging()
    file_handler = logging.FileHandler(logging_options['logfile'])

    file_handler.setLevel(logging.WARNING)
    if 'logfocus' in logging_options:
        set_logfocus(logging_options['logfocus'])
        logging.getLogger(get_logfocus()).setLevel(logging.DEBUG)

    root_logger = logging.getLogger()
    root_logger.setLevel(logging.INFO)
    root_logger.name = "LMFDB"

    formatter = logging.Formatter(
        utils.LmfdbFormatter.fmtString.split(r'[')[0])
    ch = logging.StreamHandler()
    ch.setFormatter(formatter)
    root_logger.addHandler(ch)

    app.logger.addHandler(file_handler)
예제 #7
0
파일: website.py 프로젝트: kedlaya/lmfdb
def setup_logging():
    logging_options = Configuration().get_logging();
    file_handler = logging.FileHandler(logging_options['logfile'])


    file_handler.setLevel(logging.WARNING)
    if 'logfocus' in logging_options:
        set_logfocus(logging_options['logfocus'])
        logging.getLogger(get_logfocus()).setLevel(logging.DEBUG)

    root_logger = logging.getLogger()
    root_logger.setLevel(logging.INFO)
    root_logger.name = "LMFDB"

    formatter = logging.Formatter(utils.LmfdbFormatter.fmtString.split(r'[')[0])
    ch = logging.StreamHandler()
    ch.setFormatter(formatter)
    root_logger.addHandler(ch)

    app.logger.addHandler(file_handler)
예제 #8
0
def main():
    set_logfocus(logfocus)
    logging.info("... done.")

    # just for debugging
    # if options["debug"]:
    #  logging.info(str(app.url_map))

    global configuration
    if not configuration:
        configuration = get_configuration()
    if "PROFILE" in configuration['flask_options'] and configuration[
            'flask_options']["PROFILE"]:
        print "Profiling!"
        from werkzeug.contrib.profiler import ProfilerMiddleware
        app.wsgi_app = ProfilerMiddleware(app.wsgi_app,
                                          restrictions=[30],
                                          sort_by=('cumulative', 'time',
                                                   'calls'))
        del configuration['flask_options']["PROFILE"]

    app.run(**configuration['flask_options'])
예제 #9
0
                                                   'calls'))
        del configuration['flask_options']["PROFILE"]

    app.run(**configuration['flask_options'])


if True:
    # this bit is so that we can import website.py to use with gunicorn
    if not configuration:
        configuration = get_configuration()

    file_handler = logging.FileHandler(
        configuration['logging_options']['logfile'])
    file_handler.setLevel(logging.WARNING)
    if 'logfocus' in configuration['logging_options']:
        set_logfocus(configuration['logging_options']['logfocus'])
        logging.getLogger(get_logfocus()).setLevel(logging.DEBUG)

    root_logger = logging.getLogger()
    root_logger.setLevel(logging.INFO)
    root_logger.name = "LMFDB"

    formatter = logging.Formatter(
        utils.LmfdbFormatter.fmtString.split(r'[')[0])
    ch = logging.StreamHandler()
    ch.setFormatter(formatter)
    root_logger.addHandler(ch)

    logging.info("configuration: %s" % configuration)
    _init(**configuration['mongo_client_options'])
    app.logger.addHandler(file_handler)
예제 #10
0
    root_logger = logging.getLogger()
    root_logger.setLevel(logging.INFO)
    root_logger.name = "LMFDB"
    import utils
    formatter = logging.Formatter(utils.LmfdbFormatter.fmtString.split(r'[')[0])
    ch = logging.StreamHandler()
    ch.setFormatter(formatter)
    root_logger.addHandler(ch)
    
    file_handler = logging.FileHandler(logfile)
    file_handler.setLevel(logging.WARNING)
    app.logger.addHandler(file_handler)
    
    import base
    base._init(dbport, readwrite_password)
    base.set_logfocus(logfocus)
    logging.info("... done.")

    # just for debugging
    #if options["debug"]:
    #  logging.info(str(app.url_map))

    app.run(**options)


if __name__ == '__main__':
    main()
else:
    # this bit is so that we can import website.py to use
    # with gunicorn.
    import logging
예제 #11
0
파일: website.py 프로젝트: edgarcosta/lmfdb
        print "Profiling!"
        from werkzeug.contrib.profiler import ProfilerMiddleware
        app.wsgi_app = ProfilerMiddleware(app.wsgi_app, restrictions = [30], sort_by=('cumulative','time','calls'))
        del configuration['flask_options']["PROFILE"]

    app.run(**configuration['flask_options'])

if True:
    # this bit is so that we can import website.py to use with gunicorn
    if not configuration:
        configuration = get_configuration()

    file_handler = logging.FileHandler(configuration['logging_options']['logfile'])
    file_handler.setLevel(logging.WARNING)
    if 'logfocus' in configuration['logging_options']:
        set_logfocus(configuration['logging_options']['logfocus'])
        logging.getLogger(get_logfocus()).setLevel(logging.DEBUG)

    root_logger = logging.getLogger()
    root_logger.setLevel(logging.INFO)
    root_logger.name = "LMFDB"

    formatter = logging.Formatter(utils.LmfdbFormatter.fmtString.split(r'[')[0])
    ch = logging.StreamHandler()
    ch.setFormatter(formatter)
    root_logger.addHandler(ch)

    logging.info("configuration: %s" % configuration)
    _init(**configuration['mongo_client_options'])
    app.logger.addHandler(file_handler)
    if [int(c) for c in sage.version.version.split(".")[:2]] < [int(c) for c in LMFDB_SAGE_VERSION.split(".")[:2]]: