github.com/avicd/go-utilx@v0.1.0/logx/file_test.go (about) 1 package logx 2 3 import ( 4 "testing" 5 ) 6 7 func TestFileAppender_Write(t *testing.T) { 8 //ap := &FileAppender{Name: "test-log", Cycle: Second, Split: Split{ 9 // DEBUG: true, 10 //}} 11 //for i := 0; i < 10; i++ { 12 // for j := 0; j < 1000; j++ { 13 // go func(a1, a2 int) { 14 // ap.Write(a2%5+1, "This is a Year test ", a1, ":", a2) 15 // }(i, j) 16 // } 17 // time.Sleep(time.Second) 18 //} 19 //time.Sleep(time.Second) 20 //ap.Cycle = Month 21 //for i := 1; i < int(OFF); i++ { 22 // ap.Write(Level(i), "This is a Month test") 23 //} 24 // 25 //ap.Cycle = Week 26 //for i := 1; i < int(OFF); i++ { 27 // ap.Write(Level(i), "This is a Week test") 28 //} 29 // 30 //ap.Cycle = Day 31 //for i := 1; i < int(OFF); i++ { 32 // ap.Write(Level(i), "This is a Day test") 33 //} 34 // 35 //ap.Cycle = Hour 36 //for i := 1; i < int(OFF); i++ { 37 // ap.Write(Level(i), "This is a Hour test") 38 //} 39 // 40 //ap.Cycle = Minute 41 //for i := 1; i < int(OFF); i++ { 42 // ap.Write(Level(i), "This is a Minute test") 43 //} 44 // 45 //ap.Cycle = Hour 46 //ap.Split = map[Level]bool{ 47 // WARN: true, 48 // ERROR: true, 49 // FATAL: true, 50 //} 51 //for i := 1; i < int(OFF); i++ { 52 // ap.Write(Level(i), "This is a Split test") 53 //} 54 }