diff --git a/app/__init__.py b/app/__init__.py index bf8a851..27e4732 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -1,4 +1,5 @@ import os +import logging from flask import Flask, g from flask_compress import Compress @@ -64,6 +65,9 @@ def _set_sqlite_case_insensitive_pragma(dbapi_con, connection_record): md = Markdown(app, safe_mode=True) babel.init_app(app, locale_selector=get_locale) + logging.basicConfig(filename='./pyrrha_corpus_creation.log', level=logging.DEBUG, + format='%(asctime)s %(levelname)s %(name)s %(message)s') + # Register Jinja template functions from .main import main as main_blueprint app.register_blueprint(main_blueprint) diff --git a/app/main/views/corpus.py b/app/main/views/corpus.py index a5b1ecf..6181434 100644 --- a/app/main/views/corpus.py +++ b/app/main/views/corpus.py @@ -42,8 +42,6 @@ def _get_available(): def corpus_new(): """ Register a new corpus """ - logging.basicConfig(filename='./pyrrha_corpus_creation.log', level=logging.DEBUG, - format='%(asctime)s %(levelname)s %(name)s %(message)s') logger = logging.getLogger(__name__) lemmatizers = current_app.config.get("LEMMATIZERS", [])