1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 00:22:41 +08:00

temporary

This commit is contained in:
2022-07-29 09:46:29 +08:00
parent 135b3a983b
commit 35751f7fdb
14 changed files with 153 additions and 56 deletions

View File

@ -0,0 +1,27 @@
package logx
import (
"path/filepath"
"testing"
"time"
rotatelogs "github.com/lestrrat/go-file-rotatelogs"
)
func TestNewWriter(t *testing.T) {
t.Log(filepath.Abs("logs"))
logf, err := rotatelogs.New("logs/aaaa.%Y%m%d.log",
rotatelogs.WithMaxAge(24*time.Hour),
rotatelogs.WithRotationTime(time.Hour))
if err != nil {
t.Fatal(err)
}
defer logf.Close()
t.Log(logf.CurrentFileName())
_, err = logf.Write([]byte("abaccad"))
t.Log(err)
}