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'])
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'])
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'])
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)
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)
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'])
'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)
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
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]]: