From 7ee1575dc2fa96cb3ac2d11b756bed34325d88e8 Mon Sep 17 00:00:00 2001 From: Keepers Date: Tue, 31 Jan 2023 19:41:06 -0700 Subject: [PATCH] log end-of-observe even when hidden (#2339) ## Does this PR need a docs update or release note? - [x] :no_entry: No ## Type of change - [x] :broom: Tech Debt/Cleanup ## Issue(s) * #2329 ## Test Plan - [x] :muscle: Manual --- src/internal/observe/observe.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/internal/observe/observe.go b/src/internal/observe/observe.go index d8492109d..2b86066f7 100644 --- a/src/internal/observe/observe.go +++ b/src/internal/observe/observe.go @@ -177,7 +177,7 @@ func MessageWithCompletion( completionCh := make(chan struct{}, 1) if cfg.hidden() { - return completionCh, func() {} + return completionCh, func() { log.Info("done - " + clean) } } wg.Add(1) @@ -232,7 +232,7 @@ func ItemProgress( log.Debug(header) if cfg.hidden() || rc == nil || totalBytes == 0 { - return rc, func() {} + return rc, func() { log.Debug("done - " + header) } } wg.Add(1) @@ -286,7 +286,7 @@ func ProgressWithCount( } }(progressCh) - return progressCh, func() {} + return progressCh, func() { log.Info("done - " + lmsg) } } wg.Add(1) @@ -381,16 +381,19 @@ func CollectionProgress( if cfg.hidden() || len(user.String()) == 0 || len(dirName.String()) == 0 { ch := make(chan struct{}) + counted := 0 + go func(ci <-chan struct{}) { for { _, ok := <-ci if !ok { return } + counted++ } }(ch) - return ch, func() {} + return ch, func() { log.Infow("done - "+message, "count", counted) } } wg.Add(1)