mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-06 08:47:04 +00:00
Merge pull request #2004 from marquiz/devel/grpclog
Drop setup of grpc logging
This commit is contained in:
commit
1b1a47dc77
4 changed files with 0 additions and 94 deletions
|
@ -86,9 +86,6 @@ func main() {
|
|||
klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always --match 'v*'`\" during build or run.")
|
||||
}
|
||||
|
||||
// Plug klog into grpc logging infrastructure
|
||||
utils.ConfigureGrpcKlog()
|
||||
|
||||
// Get new NfdMaster instance
|
||||
instance, err := master.NewNfdMaster(master.WithArgs(args))
|
||||
if err != nil {
|
||||
|
|
|
@ -29,7 +29,6 @@ import (
|
|||
|
||||
topology "sigs.k8s.io/node-feature-discovery/pkg/nfd-topology-updater"
|
||||
"sigs.k8s.io/node-feature-discovery/pkg/resourcemonitor"
|
||||
"sigs.k8s.io/node-feature-discovery/pkg/utils"
|
||||
"sigs.k8s.io/node-feature-discovery/pkg/utils/hostpath"
|
||||
"sigs.k8s.io/node-feature-discovery/pkg/version"
|
||||
)
|
||||
|
@ -52,9 +51,6 @@ func main() {
|
|||
klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always --match 'v*'`\" during build or run.")
|
||||
}
|
||||
|
||||
// Plug klog into grpc logging infrastructure
|
||||
utils.ConfigureGrpcKlog()
|
||||
|
||||
// Get new TopologyUpdater instance
|
||||
instance, err := topology.NewTopologyUpdater(*args, *resourcemonitorArgs)
|
||||
if err != nil {
|
||||
|
|
|
@ -59,9 +59,6 @@ func main() {
|
|||
klog.InfoS("version not set! Set -ldflags \"-X sigs.k8s.io/node-feature-discovery/pkg/version.version=`git describe --tags --dirty --always --match 'v*'`\" during build or run.")
|
||||
}
|
||||
|
||||
// Plug klog into grpc logging infrastructure
|
||||
utils.ConfigureGrpcKlog()
|
||||
|
||||
// Get new NfdWorker instance
|
||||
instance, err := worker.NewNfdWorker(worker.WithArgs(args))
|
||||
if err != nil {
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
Copyright 2021 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
// ConfigureGrpcKlog wraps grpc logging to use klog
|
||||
func ConfigureGrpcKlog() {
|
||||
grpclog.SetLoggerV2(new(grpcLogger))
|
||||
}
|
||||
|
||||
// grpcLogger implements the LoggerV2 interface from grpclog
|
||||
type grpcLogger struct{}
|
||||
|
||||
func (g grpcLogger) Error(args ...interface{}) {
|
||||
klog.ErrorDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Errorf(format string, args ...interface{}) {
|
||||
klog.ErrorDepth(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (g grpcLogger) Errorln(args ...interface{}) {
|
||||
klog.ErrorDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Fatal(args ...interface{}) {
|
||||
klog.FatalDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Fatalf(format string, args ...interface{}) {
|
||||
klog.FatalDepth(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (g grpcLogger) Fatalln(args ...interface{}) {
|
||||
klog.FatalDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Info(args ...interface{}) {
|
||||
klog.InfoDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Infof(format string, args ...interface{}) {
|
||||
klog.InfoDepth(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (g grpcLogger) Infoln(args ...interface{}) {
|
||||
klog.InfoDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Warning(args ...interface{}) {
|
||||
klog.WarningDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Warningf(format string, args ...interface{}) {
|
||||
klog.WarningDepth(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (g grpcLogger) Warningln(args ...interface{}) {
|
||||
klog.WarningDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) V(l int) bool {
|
||||
return klog.V(klog.Level(l)).Enabled()
|
||||
}
|
Loading…
Add table
Reference in a new issue