Merge branch 'development' of gitlab.ub.uni-bielefeld.de:sfb1288inf/opaque into development

This commit is contained in:
Stephan Porada 2019-12-02 16:13:57 +01:00
commit d57ced8a33

View File

@ -38,14 +38,14 @@ class DevelopmentConfig(Config):
os.environ.get('POSTGRES_PASSWORD'), os.environ.get('POSTGRES_PASSWORD'),
os.environ.get('POSTGRES_DB_NAME') os.environ.get('POSTGRES_DB_NAME')
) )
if not os.path.isfile('logs/opaque_web.log'): if not os.path.isfile('logs/nopaque.log'):
file_path = os.path.join(os.getcwd(), 'logs/opaque_web.log') file_path = os.path.join(os.getcwd(), 'logs/nopaque.log')
log = open(file_path, 'w+') log = open(file_path, 'w+')
log.close() log.close()
if os.environ.get('FLASK_CONFIG') == 'development': if os.environ.get('FLASK_CONFIG') == 'development':
log_format = ("%(asctime)s - %(levelname)s - %(name)s - " log_format = ("%(asctime)s - %(levelname)s - %(name)s - "
"%(filename)s - %(lineno)d - %(message)s") "%(filename)s - %(lineno)d - %(message)s")
logging.basicConfig(filename='logs/opaque_web.log', level='WARNING', logging.basicConfig(filename='logs/nopaque.log', level='WARNING',
format=log_format, datefmt='%Y-%m-%d %H:%M:%S', format=log_format, datefmt='%Y-%m-%d %H:%M:%S',
filemode='w') filemode='w')
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -71,14 +71,14 @@ class ProductionConfig(Config):
os.environ.get('POSTGRES_PASSWORD'), os.environ.get('POSTGRES_PASSWORD'),
os.environ.get('POSTGRES_DB_NAME') os.environ.get('POSTGRES_DB_NAME')
) )
if not os.path.isfile('logs/opaque_web.log'): if not os.path.isfile('logs/nopaque.log'):
file_path = os.path.join(os.getcwd(), 'logs/opaque_web.log') file_path = os.path.join(os.getcwd(), 'logs/nopaque.log')
log = open(file_path, 'w+') log = open(file_path, 'w+')
log.close() log.close()
if os.environ.get('FLASK_CONFIG') == 'production': if os.environ.get('FLASK_CONFIG') == 'production':
log_format = ("%(asctime)s - %(levelname)s - %(name)s - " log_format = ("%(asctime)s - %(levelname)s - %(name)s - "
"%(filename)s - %(lineno)d - %(message)s") "%(filename)s - %(lineno)d - %(message)s")
logging.basicConfig(filename='logs/opaque_web.log', level='ERROR', logging.basicConfig(filename='logs/nopaque.log', level='ERROR',
format=log_format, datefmt='%Y-%m-%d %H:%M:%S', format=log_format, datefmt='%Y-%m-%d %H:%M:%S',
filemode='w') filemode='w')
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)