mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +00:00
Fix config file name
This commit is contained in:
parent
ae30ba7186
commit
8bf71dea47
12
config.py
12
config.py
@ -38,14 +38,14 @@ class DevelopmentConfig(Config):
|
||||
os.environ.get('POSTGRES_PASSWORD'),
|
||||
os.environ.get('POSTGRES_DB_NAME')
|
||||
)
|
||||
if not os.path.isfile('logs/opaque_web.log'):
|
||||
file_path = os.path.join(os.getcwd(), 'logs/opaque_web.log')
|
||||
if not os.path.isfile('logs/nopaque.log'):
|
||||
file_path = os.path.join(os.getcwd(), 'logs/nopaque.log')
|
||||
log = open(file_path, 'w+')
|
||||
log.close()
|
||||
if os.environ.get('FLASK_CONFIG') == 'development':
|
||||
log_format = ("%(asctime)s - %(levelname)s - %(name)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',
|
||||
filemode='w')
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -71,14 +71,14 @@ class ProductionConfig(Config):
|
||||
os.environ.get('POSTGRES_PASSWORD'),
|
||||
os.environ.get('POSTGRES_DB_NAME')
|
||||
)
|
||||
if not os.path.isfile('logs/opaque_web.log'):
|
||||
file_path = os.path.join(os.getcwd(), 'logs/opaque_web.log')
|
||||
if not os.path.isfile('logs/nopaque.log'):
|
||||
file_path = os.path.join(os.getcwd(), 'logs/nopaque.log')
|
||||
log = open(file_path, 'w+')
|
||||
log.close()
|
||||
if os.environ.get('FLASK_CONFIG') == 'production':
|
||||
log_format = ("%(asctime)s - %(levelname)s - %(name)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',
|
||||
filemode='w')
|
||||
logger = logging.getLogger(__name__)
|
||||
|
Loading…
Reference in New Issue
Block a user