mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
add context for intlog
This commit is contained in:
@ -335,15 +335,15 @@ func Test_Router_DomainGroup(t *testing.T) {
|
||||
d.Group("/", func(group *ghttp.RouterGroup) {
|
||||
group.Group("/app", func(gApp *ghttp.RouterGroup) {
|
||||
gApp.GET("/{table}/list/{page}.html", func(r *ghttp.Request) {
|
||||
intlog.Print("/{table}/list/{page}.html")
|
||||
intlog.Print(r.Context(), "/{table}/list/{page}.html")
|
||||
r.Response.Write(r.Get("table"), "&", r.Get("page"))
|
||||
})
|
||||
gApp.GET("/order/info/{order_id}", func(r *ghttp.Request) {
|
||||
intlog.Print("/order/info/{order_id}")
|
||||
intlog.Print(r.Context(), "/order/info/{order_id}")
|
||||
r.Response.Write(r.Get("order_id"))
|
||||
})
|
||||
gApp.DELETE("/comment/{id}", func(r *ghttp.Request) {
|
||||
intlog.Print("/comment/{id}")
|
||||
intlog.Print(r.Context(), "/comment/{id}")
|
||||
r.Response.Write(r.Get("id"))
|
||||
})
|
||||
})
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
package gbuild
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf"
|
||||
"github.com/gogf/gf/container/gvar"
|
||||
"github.com/gogf/gf/encoding/gbase64"
|
||||
@ -26,13 +27,13 @@ func init() {
|
||||
if builtInVarStr != "" {
|
||||
err := json.UnmarshalUseNumber(gbase64.MustDecodeString(builtInVarStr), &builtInVarMap)
|
||||
if err != nil {
|
||||
intlog.Error(err)
|
||||
intlog.Error(context.TODO(), err)
|
||||
}
|
||||
builtInVarMap["gfVersion"] = gf.VERSION
|
||||
builtInVarMap["goVersion"] = runtime.Version()
|
||||
intlog.Printf("build variables: %+v", builtInVarMap)
|
||||
intlog.Printf(context.TODO(), "build variables: %+v", builtInVarMap)
|
||||
} else {
|
||||
intlog.Print("no build variables")
|
||||
intlog.Print(context.TODO(), "no build variables")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user