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:
@@ -26,12 +26,12 @@ function getPool() {
|
||||
cachedPool.on("acquire", () => {
|
||||
connectionCount++;
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("\x1b[36m%s\x1b[0m", `➕ Connection acquired (${connectionCount} total)`);
|
||||
}
|
||||
if (connectionCount > maxUsed) {
|
||||
maxUsed = connectionCount;
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log(`📈 Neue Höchstzahl aktiver gleichzeitiger Verbindungen: ${maxUsed}`);
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ function getPool() {
|
||||
cachedPool.on("release", () => {
|
||||
connectionCount--;
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.log("\x1b[32m%s\x1b[0m", `➖ Connection released (${connectionCount} total)`);
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ function getPool() {
|
||||
|
||||
cachedPool.on("enqueue", () => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
if (process.env.NEXT_PUBLIC_DEBUG_LOG === "true") {
|
||||
if (getDebugLog()) {
|
||||
console.warn("\x1b[33m%s\x1b[0m", "⏳ Pool voll – Anfrage in Warteschlange");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user