mirror of
https://gitee.com/johng/gf
synced 2026-06-07 10:22:11 +08:00
glog增加debug模式示例代码
This commit is contained in:
19
geg/os/glog/glog_debug.go
Normal file
19
geg/os/glog/glog_debug.go
Normal file
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"time"
|
||||
"gitee.com/johng/gf/g/os/glog"
|
||||
"gitee.com/johng/gf/g/os/gtime"
|
||||
)
|
||||
|
||||
func main() {
|
||||
gtime.SetTimeout(3*time.Second, func() {
|
||||
glog.SetDebug(false)
|
||||
})
|
||||
for {
|
||||
glog.Debug(gtime.Datetime())
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user