From f7b8e970b29aff665e801a65309c9b56d3ac7d6a Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 12 Jan 2026 11:02:15 +0800 Subject: [PATCH] Refactor Logging in Request Render Method - Removed the dependency on the color package for logging warnings about uncached pages. - Simplified the logging statement to directly use the log package, improving code clarity and reducing unnecessary imports. --- sui/api/request.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sui/api/request.go b/sui/api/request.go index a8f1e9cf..a49716f2 100644 --- a/sui/api/request.go +++ b/sui/api/request.go @@ -9,7 +9,6 @@ import ( "strings" "time" - "github.com/fatih/color" "github.com/gin-gonic/gin" jsoniter "github.com/json-iterator/go" "github.com/yaoapp/gou/application" @@ -94,9 +93,7 @@ func (r *Request) Render() (string, int, error) { if c == nil { - message := fmt.Sprintf("[SUI] The page %s is not cached. file=%s DisableCache=%v", r.Request.URL.Path, r.File, r.Request.DisableCache()) - go fmt.Println(color.YellowString(message)) - go log.Warn("%s", message) + go log.Warn("[SUI] The page %s is not cached. file=%s DisableCache=%v", r.Request.URL.Path, r.File, r.Request.DisableCache()) var status int var err error