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:
@@ -5,14 +5,8 @@
|
||||
* @returns {Promise<Array>} Liste mit Points[]
|
||||
* @throws {Error} bei Fehler oder ungültiger Antwortstruktur
|
||||
*/
|
||||
let __configCache;
|
||||
async function getConfig() {
|
||||
if (__configCache) return __configCache;
|
||||
const res = await fetch("/config.json");
|
||||
if (!res.ok) throw new Error("config.json konnte nicht geladen werden");
|
||||
__configCache = await res.json();
|
||||
return __configCache;
|
||||
}
|
||||
|
||||
import { getDebugLog, getConfig } from "../../utils/configUtils";
|
||||
|
||||
export const fetchGisStationsStaticDistrictService = async () => {
|
||||
const useMocks = process.env.NEXT_PUBLIC_USE_MOCKS === "true";
|
||||
@@ -22,7 +16,7 @@ export const fetchGisStationsStaticDistrictService = async () => {
|
||||
if (useMocks) {
|
||||
const mockBasePath = "/api/mocks/webservice/gisStationsStaticDistrict";
|
||||
const mockURL = `${window.location.origin}${mockBasePath}`;
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("🧪 Mock-Modus aktiviert: fetchGisStationsStaticDistrictService ", mockURL);
|
||||
}
|
||||
|
||||
@@ -45,7 +39,7 @@ export const fetchGisStationsStaticDistrictService = async () => {
|
||||
const idUser = params.get("u");
|
||||
|
||||
const url = `${baseUrl}/GisStationsStaticDistrict?idMap=${idMap}&idUser=${idUser}`;
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("📡 fetchGisStationsStaticDistrictService URL:", url);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user