1 Star 5 Fork 1

A-涛 / ps-log

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 532 Bytes
一键复制 编辑 原始数据 按行查看 历史
A-涛 提交于 2023-01-12 15:20 . 移除 xlog
package main
import (
"fmt"
pslog "gitee.com/xuesongtao/ps-log"
)
func main() {
w, err := pslog.NewWatch()
if err != nil {
panic(err)
}
defer w.Close()
dir := "/Users/xuesongtao/goProject/src/myGo/ps-log/_example/watch"
watchList := []string{
dir + "/tmp",
dir + "/tmp1/test.txt",
dir + "/tmp2/test.txt",
}
if err := w.Add(watchList...); err != nil {
panic(err)
}
handleCh := make(chan *pslog.WatchFileInfo, 3)
w.Watch(handleCh)
for c := range handleCh {
fmt.Println(c.Path)
}
<-make(chan int, 1)
}
Go
1
https://gitee.com/xuesongtao/ps-log.git
git@gitee.com:xuesongtao/ps-log.git
xuesongtao
ps-log
ps-log
v1.0.14

搜索帮助