mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-05 16:27:05 +00:00
Merge pull request #475 from marquiz/devel/grpc-klog
pkg/utils: show correct source file in gRPC logs
This commit is contained in:
commit
03f53d85e9
1 changed files with 14 additions and 12 deletions
|
@ -17,6 +17,8 @@ limitations under the License.
|
|||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
@ -30,51 +32,51 @@ func ConfigureGrpcKlog() {
|
|||
type grpcLogger struct{}
|
||||
|
||||
func (g grpcLogger) Error(args ...interface{}) {
|
||||
klog.Error(args...)
|
||||
klog.ErrorDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Errorf(format string, args ...interface{}) {
|
||||
klog.Errorf(format, args...)
|
||||
klog.ErrorDepth(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (g grpcLogger) Errorln(args ...interface{}) {
|
||||
klog.Errorln(args...)
|
||||
klog.ErrorDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Fatal(args ...interface{}) {
|
||||
klog.Fatal(args...)
|
||||
klog.FatalDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Fatalf(format string, args ...interface{}) {
|
||||
klog.Fatalf(format, args...)
|
||||
klog.FatalDepth(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (g grpcLogger) Fatalln(args ...interface{}) {
|
||||
klog.Fatalln(args...)
|
||||
klog.FatalDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Info(args ...interface{}) {
|
||||
klog.Info(args...)
|
||||
klog.InfoDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Infof(format string, args ...interface{}) {
|
||||
klog.Infof(format, args...)
|
||||
klog.InfoDepth(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (g grpcLogger) Infoln(args ...interface{}) {
|
||||
klog.Infoln(args...)
|
||||
klog.InfoDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Warning(args ...interface{}) {
|
||||
klog.Warning(args...)
|
||||
klog.WarningDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) Warningf(format string, args ...interface{}) {
|
||||
klog.Warningf(format, args...)
|
||||
klog.WarningDepth(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (g grpcLogger) Warningln(args ...interface{}) {
|
||||
klog.Warningln(args...)
|
||||
klog.WarningDepth(2, args...)
|
||||
}
|
||||
|
||||
func (g grpcLogger) V(l int) bool {
|
||||
|
|
Loading…
Add table
Reference in a new issue