chore(watch): Add changed files path/count to log

Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
This commit is contained in:
Suleiman Dibirov 2024-09-11 18:03:13 +03:00 committed by Guillaume Lours
parent 155f64182a
commit 2e14191682
1 changed files with 12 additions and 6 deletions

View File

@ -553,13 +553,19 @@ func writeWatchSyncMessage(log api.LogConsumer, serviceName string, pathMappings
for i := range pathMappings { for i := range pathMappings {
hostPathsToSync[i] = pathMappings[i].HostPath hostPathsToSync[i] = pathMappings[i].HostPath
} }
log.Log(api.WatchLogger, fmt.Sprintf("Syncing %q after changes were detected", serviceName)) log.Log(
api.WatchLogger,
fmt.Sprintf(
"Syncing %q after changes were detected: %s",
serviceName,
strings.Join(hostPathsToSync, ", "),
),
)
} else { } else {
hostPathsToSync := make([]string, len(pathMappings)) log.Log(
for i := range pathMappings { api.WatchLogger,
hostPathsToSync[i] = pathMappings[i].HostPath fmt.Sprintf("Syncing service %q after %d changes were detected", serviceName, len(pathMappings)),
} )
log.Log(api.WatchLogger, fmt.Sprintf("Syncing service %q after %d changes were detected", serviceName, len(pathMappings)))
} }
} }