Modif watchdog relevés
This commit is contained in:
@@ -5,12 +5,24 @@ from datetime import datetime, timedelta
|
||||
from dotenv import load_dotenv
|
||||
import os
|
||||
import logging
|
||||
|
||||
import sys
|
||||
import mysql.connector # important pour cibler les exceptions MySQL
|
||||
|
||||
import utils_db
|
||||
from utils_mail import envoyer_mail
|
||||
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s - %(levelname)s - %(message)s",
|
||||
handlers=[logging.StreamHandler(sys.stdout)]
|
||||
)
|
||||
|
||||
# Forcer l'encodage UTF-8 du flux si possible (Windows/PyCharm)
|
||||
try:
|
||||
sys.stdout.reconfigure(encoding="utf-8")
|
||||
except Exception:
|
||||
pass
|
||||
# -------------------- LOGS --------------------
|
||||
LOG_DIR = '/home/debian/Gestion_sondes/Logs'
|
||||
os.makedirs(LOG_DIR, exist_ok=True)
|
||||
|
||||
Reference in New Issue
Block a user