Source File
logger.go
Belonging Package
google.golang.org/grpc/grpclog/internal
/*
*
* Copyright 2024 gRPC 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 internal
// Logger mimics golang's standard Logger as an interface.
//
// Deprecated: use LoggerV2.
type Logger interface {
Fatal(args ...any)
Fatalf(format string, args ...any)
Fatalln(args ...any)
Print(args ...any)
Printf(format string, args ...any)
Println(args ...any)
}
// LoggerWrapper wraps Logger into a LoggerV2.
type LoggerWrapper struct {
Logger
}
// Info logs to INFO log. Arguments are handled in the manner of fmt.Print.
func ( *LoggerWrapper) ( ...any) {
.Logger.Print(...)
}
// Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println.
func ( *LoggerWrapper) ( ...any) {
.Logger.Println(...)
}
// Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.
func ( *LoggerWrapper) ( string, ...any) {
.Logger.Printf(, ...)
}
// Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print.
func ( *LoggerWrapper) ( ...any) {
.Logger.Print(...)
}
// Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println.
func ( *LoggerWrapper) ( ...any) {
.Logger.Println(...)
}
// Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.
func ( *LoggerWrapper) ( string, ...any) {
.Logger.Printf(, ...)
}
// Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.
func ( *LoggerWrapper) ( ...any) {
.Logger.Print(...)
}
// Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println.
func ( *LoggerWrapper) ( ...any) {
.Logger.Println(...)
}
// Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
func ( *LoggerWrapper) ( string, ...any) {
.Logger.Printf(, ...)
}
// V reports whether verbosity level l is at least the requested verbose level.
func (*LoggerWrapper) (int) bool {
// Returns true for all verbose level.
return true
}
The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64)