From 668fd905c0f7f9977eed33debe7f30ec8cc5f3d1 Mon Sep 17 00:00:00 2001 From: Juliettejns Date: Wed, 11 Sep 2024 17:14:16 +0200 Subject: [PATCH] =?UTF-8?q?d=C3=A9placement=20logging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/__init__.py | 4 ++++ app/main/views/corpus.py | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) 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", [])