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:
@@ -88,6 +88,7 @@ import { monitorHeapWithRedux } from "@/utils/common/monitorMemory";
|
||||
import { io } from "socket.io-client";
|
||||
|
||||
import { setGisStationsStaticDistrict } from "@/redux/slices/webservice/gisStationsStaticDistrictSlice.js";
|
||||
import { getDebugLog } from "../../utils/configUtils";
|
||||
//-----------------------------------------------------------------------------------------------------
|
||||
const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
//-------------------------------
|
||||
@@ -509,7 +510,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
//Test in useEffect
|
||||
useEffect(() => {
|
||||
if (map) {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("🗺️ Map-Einstellungen werden wiederhergestellt...");
|
||||
}
|
||||
restoreMapSettings(map);
|
||||
@@ -518,7 +519,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
//--------------------------------------------
|
||||
useEffect(() => {
|
||||
if (map) {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("map in MapComponent: ", map);
|
||||
}
|
||||
const handleMapMoveEnd = event => {
|
||||
@@ -551,7 +552,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
const station = points.find(s => s.Area_Name === selectedArea);
|
||||
|
||||
if (station) {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("📌 Gefundene Station:", station);
|
||||
}
|
||||
map.flyTo([station.X, station.Y], 14);
|
||||
@@ -597,7 +598,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
//--------------------------------------------
|
||||
useEffect(() => {
|
||||
if (map) {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("6- Karteninstanz (map) wurde jetzt erfolgreich initialisiert");
|
||||
}
|
||||
}
|
||||
@@ -610,7 +611,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
map.whenReady(() => {
|
||||
timeoutId = setTimeout(() => {
|
||||
if (map.contextmenu) {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("Contextmenu ist vorhanden");
|
||||
}
|
||||
} else {
|
||||
@@ -641,7 +642,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
const handleLocationUpdate = async (idLocation, idMap, newCoords) => {
|
||||
try {
|
||||
await dispatch(updateAreaThunk({ idLocation, idMap, newCoords })).unwrap();
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("Koordinaten erfolgreich aktualisiert:", result);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -810,7 +811,7 @@ const MapComponent = ({ locations, onLocationUpdate, lineCoordinates }) => {
|
||||
// console.log(`⏳ Redux Countdown: ${countdown} Sekunden`);
|
||||
|
||||
if (countdown <= 2) {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("🚀 Kontextmenü wird wegen Countdown < 2 geschlossen.");
|
||||
}
|
||||
dispatch(closePolylineContextMenu());
|
||||
|
||||
Reference in New Issue
Block a user