Read reads data from the underlying io.Reader and logs it.
(p []byte)
| 27 | |
| 28 | // Read reads data from the underlying io.Reader and logs it. |
| 29 | func (l *IOLogger) Read(p []byte) (n int, err error) { |
| 30 | if l.reader == nil { |
| 31 | return 0, io.EOF |
| 32 | } |
| 33 | n, err = l.reader.Read(p) |
| 34 | if n > 0 { |
| 35 | l.logger.Info("[stdin]: received bytes", "count", n, "data", string(p[:n])) |
| 36 | } |
| 37 | return n, err |
| 38 | } |
| 39 | |
| 40 | // Write writes data to the underlying io.Writer and logs it. |
| 41 | func (l *IOLogger) Write(p []byte) (n int, err error) { |
no outgoing calls