You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
513 B
22 lines
513 B
package main
|
|
|
|
import (
|
|
"git.drinkme.beer/yinghe/log"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
log.Infof("hahah")
|
|
|
|
log.ReloadLogger("./conf/cfg.toml")
|
|
log.Infof(" reloaded.")
|
|
|
|
now := time.Now()
|
|
log.RotateLogger(log.New(`./logs/cmd.`+now.Format(time.RFC3339), `./logs/cmd`))
|
|
log.Info("ping")
|
|
log.RotateLogger(log.New(`./logs/cmd.`+now.Format(time.RFC3339), `./logs/cmd`))
|
|
log.Infof("pong")
|
|
|
|
log.RotateLogger(log.New(`./logs/cmd.`+now.Add(time.Hour).Format(time.RFC3339), `./logs/cmd`))
|
|
log.Infof("one hour later....")
|
|
}
|