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