Skip to content

baagod/rotatefile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rotatefile

a simple Go log rotation library

一个简单的 Go 日志轮换库。

Install 安装

go get -u github.com/baagod/rotatefile@main

Example 用例

file, _ := New("logs/day.log", rotatefile.PerMinute)

for i := 0; i < 1000; i++ {
    now := time.Now().Format(time.DateTime)
    _, _ = file.Write([]byte(fmt.Sprintf("%d: %s\n", i, now)))
    fmt.Println(now)
    time.Sleep(time.Second)
}

About

a simple Go log rotation library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages