diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-05-08 08:33:44 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2020-05-13 11:49:17 -0700 |
commit | b6113e2b9ea8f397e345a09335c26f953994c6f4 (patch) | |
tree | 5dfe310f20bc1b0ad5cadb84ef8416253df438ad /libpod/container_api.go | |
parent | d147b3ee027580dd7afdeb0fa04d990ae1d2ee91 (diff) | |
download | podman-b6113e2b9ea8f397e345a09335c26f953994c6f4.tar.gz podman-b6113e2b9ea8f397e345a09335c26f953994c6f4.tar.bz2 podman-b6113e2b9ea8f397e345a09335c26f953994c6f4.zip |
WIP V2 attach bindings and test
* Add ErrLostSync to report lost of sync when de-mux'ing stream
* Add logus.SetLevel(logrus.DebugLevel) when `go test -v` given
* Add context to debugging messages
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index b31079b26..d366ffb84 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -285,6 +285,7 @@ func (c *Container) HTTPAttach(httpCon net.Conn, httpBuf *bufio.ReadWriter, stre logrus.Infof("Performing HTTP Hijack attach to container %s", c.ID()) + logSize := 0 if streamLogs { // Get all logs for the container logChan := make(chan *logs.LogLine) @@ -302,7 +303,7 @@ func (c *Container) HTTPAttach(httpCon net.Conn, httpBuf *bufio.ReadWriter, stre device := logLine.Device var header []byte headerLen := uint32(len(logLine.Msg)) - + logSize += len(logLine.Msg) switch strings.ToLower(device) { case "stdin": header = makeHTTPAttachHeader(0, headerLen) @@ -341,7 +342,7 @@ func (c *Container) HTTPAttach(httpCon net.Conn, httpBuf *bufio.ReadWriter, stre if err := c.ReadLog(logOpts, logChan); err != nil { return err } - logrus.Debugf("Done reading logs for container %s", c.ID()) + logrus.Debugf("Done reading logs for container %s, %d bytes", c.ID(), logSize) if err := <-errChan; err != nil { return err } |