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....") }