refactors logging and config

This commit is contained in:
2025-02-10 16:34:11 +01:00
parent d1f562ce94
commit 33621bdec4
14 changed files with 114 additions and 147 deletions

View File

@@ -6,16 +6,9 @@ from app.forms import ScrapingForm
from app.util import get_size
from app.config import load_config
from app.api import scraper as scraper
from app.logging_config import get_logger
from app.analysis import load_data, load_analysis_modules
print(f"A imported log_file_name: {log_file_name}")
config = load_config()
logger = get_logger()
views_bp = Blueprint("views", __name__)
def register_views(app):
@@ -42,8 +35,8 @@ def register_views(app):
if not scraper:
print("Scraper not initialized")
data_dir = os.path.abspath(config['DATA']['DATA_DIR'])
log_dir = os.path.abspath(config['LOGGING']['LOG_DIR'])
data_dir = os.path.abspath(current_app.config['DATA']['DATA_DIR'])
log_dir = os.path.abspath(current_app.config['LOGGING']['LOG_DIR'])
data_files = glob.glob(os.path.join(data_dir, "*.csv"))
log_files = glob.glob(os.path.join(log_dir, "*.log"))