You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
294 B
Go
21 lines
294 B
Go
8 years ago
|
package log
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestCompositeWriters(t *testing.T) {
|
||
|
log := New(&CompositeWriters{
|
||
|
os.Stdout,
|
||
|
&DailyFileWriter{
|
||
|
Name: "/tmp/test.log",
|
||
|
},
|
||
|
})
|
||
|
log.SetTimeLayout("15:04:05.999")
|
||
|
log.SetName("main")
|
||
|
for i := 0; i < 5; i++ {
|
||
|
log.Info("i = %d", i)
|
||
|
}
|
||
|
}
|