-
Notifications
You must be signed in to change notification settings - Fork 36
log zh cn
gojuukaze edited this page Aug 27, 2022
·
2 revisions
YTask使用logrus打印日志
import (
"github.com/gojuukaze/YTask/v3/log"
"github.com/gojuukaze/go-watch-file")
// write to file
file,err:=watchFile.OpenWatchFile("xx.log")
if err != nil {
panic(err)
}
log.YTaskLog.SetOutput(file)
- go-watch-file :一个专为日志系统编写的读写文件库,会自动监听文件的变化,文件被删除时自动创建新文件。
// set level
log.YTaskLog.SetLevel(logrus.InfoLevel)