18790: Improve status update messages.
[arvados.git] / cmd / arvados-client / container_gateway.go
index b5f45199d6cb2e6eb44d6beb5dd1c27d4e9e71a0..9436959afd8cdadf2a949c7b6f73110d6bc49c0b 100644 (file)
@@ -70,11 +70,13 @@ func (lc *logsCommand) tailf(target string, stdout, stderr io.Writer, pollInterv
        if err != nil {
                return err
        }
+       if ctrUUID != target {
+               fmt.Fprintln(stderr, "target container UUID is", ctrUUID)
+       }
        err = lc.checkAPISupport(ctx, ctrUUID)
        if err != nil {
                return err
        }
-       fmt.Fprintln(stderr, "connecting to container", ctrUUID)
 
        var (
                // files to display
@@ -87,6 +89,9 @@ func (lc *logsCommand) tailf(target string, stdout, stderr io.Writer, pollInterv
                containerFinished = false
                // has anything worked? (if so, retry after errors)
                anySuccess = false
+               // container UUID that we most recently displayed in a
+               // "connected, polling" message (if any)
+               reportedConnection = ""
        )
 
 poll:
@@ -105,6 +110,10 @@ poll:
                                delay = pollInterval
                                continue poll
                        }
+                       if reportedConnection != ctrUUID {
+                               reportedConnection = ctrUUID
+                               fmt.Fprintln(stderr, "connected, polling for log data from container", ctrUUID)
+                       }
                        size[fnm] = currentsize
                        if oldsize, seen := mark[fnm]; !seen && currentsize > 10000 {
                                mark[fnm] = currentsize - 10000