Debug-Logging zentralisiert: Nutzung von process.env.NEXT_PUBLIC_DEBUG_LOG entfernt und auf getDebugLog() mit config.json umgestellt

- Alle Vorkommen von process.env.NEXT_PUBLIC_DEBUG_LOG entfernt
- Debug-Konfiguration erfolgt jetzt ausschließlich über public/config.json
- getDebugLog()-Utility überall verwendet
- .env-Dateien werden für Debug-Logging nicht mehr benötigt
- Alle betroffenen Komponenten, Services und API
This commit is contained in:
ISA
2025-08-22 11:10:40 +02:00
parent a013c07394
commit 3896381a8f
27 changed files with 94 additions and 84 deletions

View File

@@ -1,8 +1,9 @@
// /pages/api/talas_v5_DB/area/updateArea.js
import getPool from "../../../../utils/mysqlPool";
import { getDebugLog } from "../../../../utils/configUtils";
export default async function handler(req, res) {
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
if (getDebugLog()) {
console.log("Request erhalten:", req.method, req.body); // Debugging
}

View File

@@ -1,5 +1,6 @@
// /pages/api/talas_v5_DB/gisLines/updateLineCoordinates.js
import getPool from "../../../../utils/mysqlPool"; // Singleton-Pool importieren
import { getDebugLog } from "../../../../utils/configUtils";
export default async function handler(req, res) {
const pool = getPool(); // Singleton-Pool verwenden
@@ -34,7 +35,7 @@ export default async function handler(req, res) {
// Commit der Transaktion
await connection.commit();
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
if (getDebugLog()) {
console.log("Transaction Complete.");
}
res.status(200).json({

View File

@@ -1,12 +1,13 @@
// pages/api/talas_v5_DB/pois/addPoi.js
import getPool from "../../../../utils/mysqlPool"; // Singleton-Pool importieren
import { getDebugLog } from "../../../../utils/configUtils";
export default async function handler(req, res) {
const pool = getPool(); // Singleton-Pool verwenden
if (req.method === "POST") {
const { name, poiTypeId, latitude, longitude, idLD } = req.body;
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
if (getDebugLog()) {
console.log("Received data:", req.body); // Überprüfen der empfangenen Daten
}