starlog/archive_test.go

18 lines
311 B
Go
Raw Permalink Normal View History

2024-03-10 15:37:20 +08:00
package starlog
2024-03-10 15:39:05 +08:00
import (
"testing"
"time"
)
func TestArchiveByDate(t *testing.T) {
l := Std
SetLogFile("test.log", l, true)
2025-04-28 13:16:36 +08:00
StartArchive(l, NewArchiveByDateSize(4096, 10, 2, "test.log",
2024-03-10 15:39:05 +08:00
"_2006_01_02_15_04_05.log", true, nil, nil))
for {
time.Sleep(time.Second)
l.Infoln("hahaha", time.Now())
}
}