https://github.com/shouyingo/logwriter
go rotate writer
https://github.com/shouyingo/logwriter
log rolling wrapper writer
Last synced: 30 days ago
JSON representation
go rotate writer
- Host: GitHub
- URL: https://github.com/shouyingo/logwriter
- Owner: shouyingo
- License: mit
- Created: 2017-09-29T09:42:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-09-29T09:43:07.000Z (over 8 years ago)
- Last Synced: 2025-08-13T20:52:06.360Z (6 months ago)
- Topics: log, rolling, wrapper, writer
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logwriter
支持文件滚动的 Writer
## install
```
go get github.com/shouyingo/logwriter
```
## usage
```go
package main
import (
"github.com/shouyingo/logwriter"
)
func main() {
// create roll.log at log directory.
// each log file limits 50MB.
// max 10 files.
w := logwriter.New("log/roll.log", 50*1024*1024, 10)
w.Write([]byte("hello world\n"))
w.Sync()
}
```