fix: add open progress staging and forced key evidence to display_diag (#3)
This commit is contained in:
@@ -89,9 +89,10 @@ func (d *Diag) emit(kind, role string, forced bool, fields ...string) {
|
||||
if d.last[key] == line {
|
||||
return
|
||||
}
|
||||
d.last[key] = line
|
||||
}
|
||||
d.count++
|
||||
key := kind + "|" + role
|
||||
d.last[key] = line
|
||||
if d.out != nil {
|
||||
fmt.Fprintln(d.out, line)
|
||||
}
|
||||
@@ -116,6 +117,18 @@ func diagValue(text string) string {
|
||||
// never bloat the journal stream.
|
||||
const diagValueMaxLen = 160
|
||||
|
||||
// Records returns the most recent distinct record per key, for tests
|
||||
// asserting what reached the writer.
|
||||
func (d *Diag) Records() []string {
|
||||
d.mu.Lock()
|
||||
defer d.mu.Unlock()
|
||||
out := make([]string, 0, len(d.last))
|
||||
for _, line := range d.last {
|
||||
out = append(out, line)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// VCSRevision returns the VCS revision the binary was built from, or
|
||||
// unknown when the build carried none. No other build or environment
|
||||
// metadata is exposed.
|
||||
|
||||
Reference in New Issue
Block a user