github.com/gogf/gf@v1.16.9/.example/os/glog/glog_debug.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/gogf/gf/frame/g"
     5  	"time"
     6  
     7  	"github.com/gogf/gf/os/gtime"
     8  	"github.com/gogf/gf/os/gtimer"
     9  )
    10  
    11  func main() {
    12  	gtimer.SetTimeout(3*time.Second, func() {
    13  		g.Log().SetDebug(false)
    14  	})
    15  	for {
    16  		g.Log().Debug(gtime.Datetime())
    17  		time.Sleep(time.Second)
    18  	}
    19  }