MCPcopy
hub / github.com/docker/compose / printEvent

Method printEvent

cmd/display/tty.go:227–245  ·  cmd/display/tty.go::ttyWriter.printEvent
(e api.Resource)

Source from the content-addressed store, hash-verified

225}
226
227func (w *ttyWriter) printEvent(e api.Resource) {
228 if w.operation != "" {
229 // event will be displayed by progress UI on ticker's ticks
230 return
231 }
232
233 var color colorFunc
234 switch e.Status {
235 case api.Working:
236 color = SuccessColor
237 case api.Done:
238 color = SuccessColor
239 case api.Warning:
240 color = WarningColor
241 case api.Error:
242 color = ErrorColor
243 }
244 _, _ = fmt.Fprintf(w.out, "%s %s %s\n", e.ID, color(e.Text), e.Details)
245}
246
247func (w *ttyWriter) parentTasks() iter.Seq[*task] {
248 return func(yield func(*task) bool) {

Callers 1

eventMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected