Go: move logger to common module (#14545)

### What problem does this PR solve?

As title

### Type of change

- [x] Refactoring

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
Jin Hai
2026-05-06 10:41:58 +08:00
committed by GitHub
parent 3a51c27a75
commit aa57b5bd8b
56 changed files with 628 additions and 717 deletions

View File

@@ -22,7 +22,6 @@ import (
"net/http"
"ragflow/internal/common"
"ragflow/internal/dao"
"ragflow/internal/logger"
"ragflow/internal/server"
"ragflow/internal/service"
"ragflow/internal/utility"
@@ -1220,7 +1219,7 @@ func (h *Handler) HandleNoRoute(c *gin.Context) {
// GetLogLevel returns the current log level
func (h *Handler) GetLogLevel(c *gin.Context) {
level := logger.GetLevel()
level := common.GetLevel()
success(c, gin.H{"level": level}, "")
}
@@ -1237,7 +1236,7 @@ func (h *Handler) SetLogLevel(c *gin.Context) {
return
}
if err := logger.SetLevel(req.Level); err != nil {
if err := common.SetLevel(req.Level); err != nil {
errorResponse(c, err.Error(), 400)
return
}