go-kit/log/log_test.go

16 lines
248 B
Go
Raw Permalink Normal View History

package log_test
2021-03-29 08:35:42 +02:00
type testWriter struct {
LogLines []string
}
2021-03-29 08:35:42 +02:00
func (tw *testWriter) Write(p []byte) (int, error) {
tw.LogLines = append(tw.LogLines, string(p))
2021-03-29 08:35:42 +02:00
return len(p), nil
}
2021-03-29 08:35:42 +02:00
func (tw *testWriter) Flush() {
tw.LogLines = []string{}
}