Skip to content

Commit cc8eb69

Browse files
committed
fix(modules-config): remove gin default logger middleware to eliminate non-standardized HTTP logs while maintaining catcher logging standard and panic protection.
1 parent bbba7fe commit cc8eb69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/modules-config/handlers.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package main
22

33
import (
4-
"fmt"
54
"net"
65
"net/http"
76

@@ -36,7 +35,8 @@ func startGRPCServer() error {
3635
func startHTTPServer() {
3736
gin.SetMode(gin.ReleaseMode)
3837

39-
router := gin.Default()
38+
router := gin.New()
39+
router.Use(gin.Recovery())
4040
modules := router.Group("/api/v1/modules-config")
4141
modules.POST("", HttpMiddleware(), UpdateModuleConfig)
4242
modules.POST("/validate", HttpMiddleware(), ValidateModuleConfig)
@@ -71,7 +71,7 @@ func UpdateModuleConfig(c *gin.Context) {
7171
if len(body) != 0 {
7272
config.GetConfigServer().NotifyUpdate(moduleName, &body[0])
7373
} else {
74-
fmt.Println("Received empty configuration body, no updates made")
74+
catcher.Info("Received empty configuration body, no updates made", nil)
7575
}
7676

7777
c.JSON(http.StatusOK, gin.H{"status": "Module configuration updated successfully"})

0 commit comments

Comments
 (0)