Description: Log with sirupsen/logrus to avoid a dependency to containerd
 That would be a circular dependency.
 .
 The patch is not necessarily what upstream wants, there are different log
 libraries around. However logrus is very often used in the docker ecosystem,
 so let's give it a try and see what upstream thinks of it.
Author: Arnaud Rebillout <arnaud.rebillout@collabora.com>
Forwarded: https://github.com/stevvooe/ttrpc/pull/24
Last-Update: 2018-03-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/client.go
+++ b/client.go
@@ -9,9 +9,9 @@
 	"sync"
 	"syscall"
 
-	"github.com/containerd/containerd/log"
 	"github.com/gogo/protobuf/proto"
 	"github.com/pkg/errors"
+	"github.com/sirupsen/logrus"
 	"google.golang.org/grpc/status"
 )
 
@@ -180,7 +180,7 @@
 		case msg := <-incoming:
 			call, ok := waiters[msg.StreamID]
 			if !ok {
-				log.L.Errorf("ttrpc: received message for unknown channel %v", msg.StreamID)
+				logrus.Errorf("ttrpc: received message for unknown channel %v", msg.StreamID)
 				continue
 			}
 
--- a/server.go
+++ b/server.go
@@ -9,8 +9,8 @@
 	"sync/atomic"
 	"time"
 
-	"github.com/containerd/containerd/log"
 	"github.com/pkg/errors"
+	"github.com/sirupsen/logrus"
 	"google.golang.org/grpc/codes"
 	"google.golang.org/grpc/status"
 )
@@ -88,7 +88,7 @@
 				}
 
 				sleep := time.Duration(rand.Int63n(int64(backoff)))
-				log.L.WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep)
+				logrus.WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep)
 				time.Sleep(sleep)
 				continue
 			}
@@ -100,7 +100,7 @@
 
 		approved, handshake, err := handshaker.Handshake(ctx, conn)
 		if err != nil {
-			log.L.WithError(err).Errorf("ttrpc: refusing connection after handshake")
+			logrus.WithError(err).Errorf("ttrpc: refusing connection after handshake")
 			conn.Close()
 			continue
 		}
@@ -416,12 +416,12 @@
 		case response := <-responses:
 			p, err := c.server.codec.Marshal(response.resp)
 			if err != nil {
-				log.L.WithError(err).Error("failed marshaling response")
+				logrus.WithError(err).Error("failed marshaling response")
 				return
 			}
 
 			if err := ch.send(ctx, response.id, messageTypeResponse, p); err != nil {
-				log.L.WithError(err).Error("failed sending message on channel")
+				logrus.WithError(err).Error("failed sending message on channel")
 				return
 			}
 
@@ -432,7 +432,7 @@
 			// requests due to a terminal error.
 			recvErr = nil // connection is now "closing"
 			if err != nil && err != io.EOF {
-				log.L.WithError(err).Error("error receiving message")
+				logrus.WithError(err).Error("error receiving message")
 			}
 		case <-shutdown:
 			return
