mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-02 02:40:35 +00:00
Enhance logging.
This commit is contained in:
@ -36,11 +36,17 @@ 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')
|
||||
log = open(file_path, 'w+')
|
||||
log.close()
|
||||
log_format = ("%(asctime)s - %(levelname)s - %(name)s - "
|
||||
"%(filename)s - %(lineno)d - %(message)s")
|
||||
logging.basicConfig(filename='logs/opaque_flask.log', level='WARNING',
|
||||
logging.basicConfig(filename='logs/opaque_web.log', level='WARNING',
|
||||
format=log_format, datefmt='%Y-%m-%d %H:%M:%S',
|
||||
filemode='w')
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.info('Logging has started.')
|
||||
|
||||
|
||||
class TestingConfig(Config):
|
||||
|
Reference in New Issue
Block a user