diff --git a/internal/task/executor.go b/internal/task/executor.go index 5ba48b58a..2935f61b1 100644 --- a/internal/task/executor.go +++ b/internal/task/executor.go @@ -5,7 +5,9 @@ import ( "fmt" "runtime/debug" "sync" + "time" + "github.com/anchore/syft/internal/log" "github.com/hashicorp/go-multierror" "github.com/anchore/syft/internal/sbomsync" @@ -68,5 +70,8 @@ func runTaskSafely(ctx context.Context, t Task, resolver file.Resolver, s sbomsy } }() - return t.Execute(ctx, resolver, s) + start := time.Now() + res := t.Execute(ctx, resolver, s) + log.WithFields("task", t.Name(), "elapsed", time.Since(start)).Info("task completed") + return res }