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.
This commit is contained in:
parent
588f40df25
commit
f7b8e970b2
1 changed files with 1 additions and 4 deletions
|
|
@ -9,7 +9,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fatih/color"
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
jsoniter "github.com/json-iterator/go"
|
jsoniter "github.com/json-iterator/go"
|
||||||
"github.com/yaoapp/gou/application"
|
"github.com/yaoapp/gou/application"
|
||||||
|
|
@ -94,9 +93,7 @@ func (r *Request) Render() (string, int, error) {
|
||||||
|
|
||||||
if c == nil {
|
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 log.Warn("[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)
|
|
||||||
|
|
||||||
var status int
|
var status int
|
||||||
var err error
|
var err error
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue