(p []byte)
| 26 | } |
| 27 | |
| 28 | func (d *DebugStream) Read(p []byte) (n int, err error) { |
| 29 | n, err = d.reader.Read(p) |
| 30 | if n > 0 && d.max > d.count.Load() { |
| 31 | d.count.Add(1) |
| 32 | if err != nil { |
| 33 | d.log.Err(err). |
| 34 | Str("dir", "r"). |
| 35 | Int("count", n). |
| 36 | Msgf("%+q", p[:n]) |
| 37 | } else { |
| 38 | d.log.Debug(). |
| 39 | Str("dir", "r"). |
| 40 | Int("count", n). |
| 41 | Msgf("%+q", p[:n]) |
| 42 | } |
| 43 | } |
| 44 | return |
| 45 | } |
| 46 | |
| 47 | func (d *DebugStream) Write(p []byte) (n int, err error) { |
| 48 | n, err = d.writer.Write(p) |