Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

Commit

Permalink
Merge pull request #139 from msau42/logging
Browse files Browse the repository at this point in the history
Use protosanitizer library to log rpcs
  • Loading branch information
k8s-ci-robot authored Jan 15, 2019
2 parents 4e49a80 + c321423 commit 05e1ea8
Show file tree
Hide file tree
Showing 15 changed files with 3,034 additions and 150 deletions.
180 changes: 32 additions & 148 deletions Gopkg.lock

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@
[[override]]
name = "gopkg.in/square/go-jose.v2"
version = "2.1.7"

[[constraint]]
name = "github.com/kubernetes-csi/csi-lib-utils"
version = "0.2.0"
5 changes: 3 additions & 2 deletions pkg/csi-common/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/golang/glog"
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
"golang.org/x/net/context"
"google.golang.org/grpc"
)
Expand Down Expand Up @@ -94,12 +95,12 @@ func RunControllerandNodePublishServer(endpoint string, d *CSIDriver, cs csi.Con

func logGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
glog.V(3).Infof("GRPC call: %s", info.FullMethod)
glog.V(5).Infof("GRPC request: %+v", req)
glog.V(5).Infof("GRPC request: %s", protosanitizer.StripSecrets(req))
resp, err := handler(ctx, req)
if err != nil {
glog.Errorf("GRPC error: %v", err)
} else {
glog.V(5).Infof("GRPC response: %+v", resp)
glog.V(5).Infof("GRPC response: %s", protosanitizer.StripSecrets(resp))
}
return resp, err
}
93 changes: 93 additions & 0 deletions vendor/github.com/golang/protobuf/descriptor/descriptor.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

201 changes: 201 additions & 0 deletions vendor/github.com/kubernetes-csi/csi-lib-utils/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 05e1ea8

Please sign in to comment.