GetWriter creates an io.Writer that will actually split by line and format by LogConsumer
(consumer func(string))
| 23 | |
| 24 | // GetWriter creates an io.Writer that will actually split by line and format by LogConsumer |
| 25 | func GetWriter(consumer func(string)) io.WriteCloser { |
| 26 | return &splitWriter{ |
| 27 | buffer: bytes.Buffer{}, |
| 28 | consumer: consumer, |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | type splitWriter struct { |
| 33 | buffer bytes.Buffer |
no outgoing calls