diff --git a/.example/net/ghttp/server/exit.go b/.example/net/ghttp/server/exit.go index fa224e423..68b8d9eda 100644 --- a/.example/net/ghttp/server/exit.go +++ b/.example/net/ghttp/server/exit.go @@ -16,10 +16,10 @@ func main() { }) s.BindHookHandlerByMap(p, map[string]ghttp.HandlerFunc{ ghttp.HookBeforeServe: func(r *ghttp.Request) { - glog.To(r.Response.Writer).Println("BeforeServe") + glog.To(r.Response.Writer).Print("BeforeServe") }, ghttp.HookAfterServe: func(r *ghttp.Request) { - glog.To(r.Response.Writer).Println("AfterServe") + glog.To(r.Response.Writer).Print("AfterServe") }, }) s.SetPort(8199) diff --git a/.example/net/ghttp/server/middleware/log.go b/.example/net/ghttp/server/middleware/log.go index 5e0e8c851..09869d7ad 100644 --- a/.example/net/ghttp/server/middleware/log.go +++ b/.example/net/ghttp/server/middleware/log.go @@ -25,7 +25,7 @@ func MiddlewareCORS(r *ghttp.Request) { func MiddlewareLog(r *ghttp.Request) { r.Middleware.Next() - g.Log().Println(r.Response.Status, r.URL.Path) + g.Log().Print(r.Response.Status, r.URL.Path) } func main() { diff --git a/.example/net/ghttp/server/router/group/level.go b/.example/net/ghttp/server/router/group/level.go index 8209af16f..f0563e671 100644 --- a/.example/net/ghttp/server/router/group/level.go +++ b/.example/net/ghttp/server/router/group/level.go @@ -23,7 +23,7 @@ func MiddlewareCORS(r *ghttp.Request) { func MiddlewareLog(r *ghttp.Request) { r.Middleware.Next() - g.Log().Println(r.Response.Status, r.URL.Path) + g.Log().Print(r.Response.Status, r.URL.Path) } func main() { diff --git a/.example/os/glog/glog_category.go b/.example/os/glog/glog_category.go index 1ed526816..1aa9a7e8f 100644 --- a/.example/os/glog/glog_category.go +++ b/.example/os/glog/glog_category.go @@ -8,7 +8,7 @@ import ( func main() { path := "/tmp/glog-cat" g.Log().SetPath(path) - g.Log().Stdout(false).Cat("cat1").Cat("cat2").Println("test") + g.Log().Stdout(false).Cat("cat1").Cat("cat2").Print("test") list, err := gfile.ScanDir(path, "*", true) g.Dump(err) g.Dump(list) diff --git a/.example/os/glog/glog_file.go b/.example/os/glog/glog_file.go index 1f9ca10d2..057c4fef1 100644 --- a/.example/os/glog/glog_file.go +++ b/.example/os/glog/glog_file.go @@ -12,16 +12,16 @@ func main() { g.Log().SetStdoutPrint(false) // 使用默认文件名称格式 - g.Log().Println("标准文件名称格式,使用当前时间时期") + g.Log().Print("标准文件名称格式,使用当前时间时期") // 通过SetFile设置文件名称格式 g.Log().SetFile("stdout.log") - g.Log().Println("设置日志输出文件名称格式为同一个文件") + g.Log().Print("设置日志输出文件名称格式为同一个文件") // 链式操作设置文件名称格式 - g.Log().File("stderr.log").Println("支持链式操作") - g.Log().File("error-{Ymd}.log").Println("文件名称支持带gtime日期格式") - g.Log().File("access-{Ymd}.log").Println("文件名称支持带gtime日期格式") + g.Log().File("stderr.log").Print("支持链式操作") + g.Log().File("error-{Ymd}.log").Print("文件名称支持带gtime日期格式") + g.Log().File("access-{Ymd}.log").Print("文件名称支持带gtime日期格式") list, err := gfile.ScanDir(path, "*") g.Dump(err) diff --git a/.example/os/glog/glog_flags.go b/.example/os/glog/glog_flags.go index 14e474a4e..3ab7ea82e 100644 --- a/.example/os/glog/glog_flags.go +++ b/.example/os/glog/glog_flags.go @@ -7,9 +7,9 @@ import ( func main() { g.Log().SetFlags(glog.F_TIME_TIME | glog.F_FILE_SHORT) - g.Log().Println("time and short line number") + g.Log().Print("time and short line number") g.Log().SetFlags(glog.F_TIME_MILLI | glog.F_FILE_LONG) - g.Log().Println("time with millisecond and long line number") + g.Log().Print("time with millisecond and long line number") g.Log().SetFlags(glog.F_TIME_STD | glog.F_FILE_LONG) - g.Log().Println("standard time format and long line number") + g.Log().Print("standard time format and long line number") } diff --git a/.example/os/glog/glog_line2.go b/.example/os/glog/glog_line2.go index 4048c1ec3..ea0011462 100644 --- a/.example/os/glog/glog_line2.go +++ b/.example/os/glog/glog_line2.go @@ -5,8 +5,8 @@ import ( ) func PrintLog(content string) { - g.Log().Skip(0).Line().Println("line number with skip:", content) - g.Log().Line(true).Println("line number without skip:", content) + g.Log().Skip(0).Line().Print("line number with skip:", content) + g.Log().Line(true).Print("line number without skip:", content) } func main() { diff --git a/.example/os/glog/glog_path.go b/.example/os/glog/glog_path.go index 8e882f8ba..64b40be32 100644 --- a/.example/os/glog/glog_path.go +++ b/.example/os/glog/glog_path.go @@ -9,7 +9,7 @@ import ( func main() { path := "/tmp/glog" g.Log().SetPath(path) - g.Log().Println("日志内容") + g.Log().Print("日志内容") list, err := gfile.ScanDir(path, "*") g.Dump(err) g.Dump(list) diff --git a/.example/os/glog/glog_pool.go b/.example/os/glog/glog_pool.go index 7021cb29e..565848e93 100644 --- a/.example/os/glog/glog_pool.go +++ b/.example/os/glog/glog_pool.go @@ -12,7 +12,7 @@ func main() { path := "/Users/john/Temp/test" g.Log().SetPath(path) for { - g.Log().Println(gtime.Now().String()) + g.Log().Print(gtime.Now().String()) time.Sleep(time.Second) } } diff --git a/.example/os/glog/glog_prefix.go b/.example/os/glog/glog_prefix.go index aaf257adb..90c114354 100644 --- a/.example/os/glog/glog_prefix.go +++ b/.example/os/glog/glog_prefix.go @@ -6,6 +6,6 @@ import ( func main() { g.Log().SetPrefix("[API]") - g.Log().Println("hello world") + g.Log().Print("hello world") g.Log().Error("error occurred") } diff --git a/.example/os/glog/glog_stdout.go b/.example/os/glog/glog_stdout.go index 376e2dccf..801d65732 100644 --- a/.example/os/glog/glog_stdout.go +++ b/.example/os/glog/glog_stdout.go @@ -14,7 +14,7 @@ func main() { for i := 0; i < 3000; i++ { go func() { <-ch - g.Log().Println("abcdefghijklmnopqrstuvwxyz1234567890") + g.Log().Print("abcdefghijklmnopqrstuvwxyz1234567890") wg.Done() }() } diff --git a/os/gcron/gcron_unit_1_test.go b/os/gcron/gcron_unit_1_test.go index aef37c6ca..7d666d092 100644 --- a/os/gcron/gcron_unit_1_test.go +++ b/os/gcron/gcron_unit_1_test.go @@ -26,11 +26,11 @@ func TestCron_Add_Close(t *testing.T) { cron := gcron.New() array := garray.New(true) _, err1 := cron.Add(ctx, "* * * * * *", func(ctx context.Context) { - g.Log().Println(ctx, "cron1") + g.Log().Print(ctx, "cron1") array.Append(1) }) _, err2 := cron.Add(ctx, "* * * * * *", func(ctx context.Context) { - g.Log().Println(ctx, "cron2") + g.Log().Print(ctx, "cron2") array.Append(1) }, "test") t.Assert(err1, nil) diff --git a/os/gcron/gcron_unit_2_test.go b/os/gcron/gcron_unit_2_test.go index 3c5aa38c5..ab05ef129 100644 --- a/os/gcron/gcron_unit_2_test.go +++ b/os/gcron/gcron_unit_2_test.go @@ -24,7 +24,7 @@ func TestCron_Entry_Operations(t *testing.T) { array = garray.New(true) ) cron.DelayAddTimes(ctx, 500*time.Millisecond, "* * * * * *", 2, func(ctx context.Context) { - g.Log().Println(ctx, "add times") + g.Log().Print(ctx, "add times") array.Append(1) }) t.Assert(cron.Size(), 0) @@ -42,7 +42,7 @@ func TestCron_Entry_Operations(t *testing.T) { array = garray.New(true) ) entry, err1 := cron.Add(ctx, "* * * * * *", func(ctx context.Context) { - g.Log().Println(ctx, "add") + g.Log().Print(ctx, "add") array.Append(1) }) t.Assert(err1, nil) @@ -56,7 +56,7 @@ func TestCron_Entry_Operations(t *testing.T) { t.Assert(array.Len(), 1) t.Assert(cron.Size(), 1) entry.Start() - g.Log().Println(ctx, "start") + g.Log().Print(ctx, "start") time.Sleep(1000 * time.Millisecond) t.Assert(array.Len(), 2) t.Assert(cron.Size(), 1)