Skip to content

Commit

Permalink
Merge pull request #113 from wader/nicer-debug-versions
Browse files Browse the repository at this point in the history
Simplify verbose pipeline output
  • Loading branch information
wader authored Jun 19, 2023
2 parents e02bf9e + e375a08 commit 2f5088a
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions internal/pipeline/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,22 @@ func (pl Pipeline) Run(inVersionKey string, inVersions filter.Versions, logFn fu
versionKey := inVersionKey

for _, f := range pl {
before := vs
beforeVersionKey := versionKey
vs, versionKey, err = f.Filter(vs, versionKey)
if err != nil {
return "", nil, err
}

if logFn != nil {
after := vs
removed := before.Minus(after)
added := after.Minus(before)
if logFn != nil {
logFn("%s:", f)
logFn(" > %+v", before)
logFn(" + %+v", added)
logFn(" - %+v", removed)
for _, v := range vs {
logFn(" %v", v)
}
if len(vs) == 0 {
logFn(" (none)")
}
logFn(" @ %s -> %s", beforeVersionKey, versionKey)
logFn(" = %+v", vs)
}
}
}
Expand Down

0 comments on commit 2f5088a

Please sign in to comment.