Do not touch grpc logger from within the packages

Libraries should not make process wide changes unless requested to.

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure
2017-08-04 09:45:09 -07:00
parent 7e0063320c
commit 16f6e0944a
7 changed files with 20 additions and 20 deletions

View File

@@ -3,12 +3,16 @@ package main
import (
"context"
"fmt"
"io/ioutil"
golog "log"
"net"
"os"
"os/signal"
"runtime"
"time"
"google.golang.org/grpc/grpclog"
gocontext "golang.org/x/net/context"
"github.com/containerd/containerd/log"
@@ -31,6 +35,9 @@ high performance container runtime
`
func init() {
// Discard grpc logs so that they don't mess with our stdio
grpclog.SetLogger(golog.New(ioutil.Discard, "", golog.LstdFlags))
cli.VersionPrinter = func(c *cli.Context) {
fmt.Println(c.App.Name, version.Package, c.App.Version)
}