glog增加debug模式示例代码

This commit is contained in:
John
2018-07-22 12:21:56 +08:00
parent 1eed5b7521
commit b0882b423d
2 changed files with 19 additions and 0 deletions

19
geg/os/glog/glog_debug.go Normal file
View 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)
}
}