progressui: constant prefix index for grep

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2018-06-06 13:49:48 -07:00
parent 39e19516fc
commit 2037b9540b
2 changed files with 5 additions and 5 deletions

View File

@ -220,7 +220,7 @@ func (t *trace) update(s *client.SolveStatus) {
if v.Started != nil {
ts = l.Timestamp.Sub(*v.Started)
}
v.logs = append(v.logs, []byte(fmt.Sprintf("%s %s", fmt.Sprintf("%#.4g", ts.Seconds())[:5], dt)))
v.logs = append(v.logs, []byte(fmt.Sprintf("#%d %s %s", v.index, fmt.Sprintf("%#.4g", ts.Seconds())[:5], dt)))
}
})
v.logsPartial = !complete

View File

@ -31,17 +31,17 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
}
old.logsOffset = 0
old.count = 0
fmt.Fprintf(p.w, "# ...\n")
fmt.Fprintf(p.w, "#%d ...\n", v.index)
}
fmt.Fprintf(p.w, "\n# %d %s\n", v.index, limitString(v.Name, 72))
fmt.Fprintf(p.w, "\n#%d %s\n", v.index, limitString(v.Name, 72))
}
if len(v.events) != 0 {
v.logsOffset = 0
}
for _, ev := range v.events {
fmt.Fprintf(p.w, "# %s\n", ev)
fmt.Fprintf(p.w, "#%d %s\n", v.index, ev)
}
v.events = v.events[:0]
@ -67,7 +67,7 @@ func (p *textMux) printVtx(t *trace, dgst digest.Digest) {
if s.Completed != nil {
tm += " done"
}
fmt.Fprintf(p.w, "# %s%s%s\n", s.ID, bytes, tm)
fmt.Fprintf(p.w, "#%d %s%s%s\n", v.index, s.ID, bytes, tm)
}
}
v.statusUpdates = map[string]struct{}{}