mirror of
https://github.com/moby/moby.git
synced 2026-01-11 10:41:43 +00:00
Allows using daemon/internal packages when creating dockerd Signed-off-by: Derek McGowan <derek@mcg.dev>
20 lines
588 B
Go
20 lines
588 B
Go
package command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/containerd/log"
|
|
"google.golang.org/grpc/grpclog"
|
|
)
|
|
|
|
// grpc's default logger is *very* noisy and uses "info" and even "warn" level logging for mostly useless messages.
|
|
// This function configures the grpc logger to step down the severity of all messages.
|
|
//
|
|
// info => trace
|
|
// warn => debug
|
|
// error => warn
|
|
func configureGRPCLog(ctx context.Context) {
|
|
l := log.G(ctx).WithField("library", "grpc")
|
|
grpclog.SetLoggerV2(grpclog.NewLoggerV2(l.WriterLevel(log.TraceLevel), l.WriterLevel(log.DebugLevel), l.WriterLevel(log.WarnLevel)))
|
|
}
|