From a53547cb0b192a24baa377f903a5baeb5ef9e27b Mon Sep 17 00:00:00 2001 From: Charles Duffy Date: Thu, 5 May 2022 10:50:07 -0500 Subject: [PATCH] When verbose logging is on, log when dependencies complete This eases diagnosis of race conditions. --- mg/deps.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mg/deps.go b/mg/deps.go index f0c2509b..97de4395 100644 --- a/mg/deps.go +++ b/mg/deps.go @@ -206,6 +206,13 @@ func (o *onceFun) run(ctx context.Context) error { logger.Println("Running dependency:", displayName(o.fn.Name())) } o.err = o.fn.Run(ctx) + if Verbose() { + if o.err == nil { + logger.Printf("Finished dependency: %s\n", displayName(o.fn.Name())) + } else { + logger.Printf("Finished dependency: %s (err: %v)\n", displayName(o.fn.Name()), o.err) + } + } }) return o.err }