MCPcopy Create free account
hub / github.com/docker/compose / write

Method write

cmd/formatter/logs.go:117–130  ·  view source on GitHub ↗
(w io.Writer, container, message string)

Source from the content-addressed store, hash-verified

115}
116
117func (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
132func (l *logConsumer) Status(container, msg string) {
133 p := l.getPresenter(container)

Callers 2

LogMethod · 0.95
ErrMethod · 0.95

Calls 2

getPresenterMethod · 0.95
ErrMethod · 0.65

Tested by

no test coverage detected