channelz: remove init logging (#2373)

This commit is contained in:
lyuxuan 2018-10-12 14:34:08 -07:00 committed by GitHub
parent c05280cc73
commit 5a2acb1f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 5 deletions

View File

@ -20,11 +20,13 @@
package channelz
import "google.golang.org/grpc/grpclog"
import (
"sync"
func init() {
grpclog.Infof("Channelz: socket options are not supported on non-linux os and appengine.")
}
"google.golang.org/grpc/grpclog"
)
var once sync.Once
// SocketOptionData defines the struct to hold socket option data, and related
// getter function to obtain info from fd.
@ -35,4 +37,8 @@ type SocketOptionData struct {
// Getsockopt defines the function to get socket options requested by channelz.
// It is to be passed to syscall.RawConn.Control().
// Windows OS doesn't support Socket Option
func (s *SocketOptionData) Getsockopt(fd uintptr) {}
func (s *SocketOptionData) Getsockopt(fd uintptr) {
once.Do(func() {
grpclog.Warningln("Channelz: socket options are not supported on non-linux os and appengine.")
})
}