(w io.Writer, container, message string)
| 115 | } |
| 116 | |
| 117 | func (l *logConsumer) write(w io.Writer, container, message string) { |
| 118 | if l.ctx.Err() != nil { |
| 119 | return |
| 120 | } |
| 121 | p := l.getPresenter(container) |
| 122 | timestamp := time.Now().Format(jsonmessage.RFC3339NanoFixed) |
| 123 | for line := range strings.SplitSeq(message, "\n") { |
| 124 | if l.timestamp { |
| 125 | _, _ = fmt.Fprintf(w, "%s%s %s\n", p.prefix, timestamp, line) |
| 126 | } else { |
| 127 | _, _ = fmt.Fprintf(w, "%s%s\n", p.prefix, line) |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | |
| 132 | func (l *logConsumer) Status(container, msg string) { |
| 133 | p := l.getPresenter(container) |
no test coverage detected