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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user