Source File
grpclog.go
Belonging Package
google.golang.org/grpc/grpclog
/*
*
* Copyright 2017 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 grpclog defines logging for grpc.
//
// In the default logger, severity level can be set by environment variable
// GRPC_GO_LOG_SEVERITY_LEVEL, verbosity level can be set by
// GRPC_GO_LOG_VERBOSITY_LEVEL.
package grpclog
import (
)
func () {
SetLoggerV2(newLoggerV2())
}
// V reports whether verbosity level l is at least the requested verbose level.
func ( int) bool {
return internal.LoggerV2Impl.V()
}
// Info logs to the INFO log.
func ( ...any) {
internal.LoggerV2Impl.Info(...)
}
// Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf.
func ( string, ...any) {
internal.LoggerV2Impl.Infof(, ...)
}
// Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println.
func ( ...any) {
internal.LoggerV2Impl.Infoln(...)
}
// Warning logs to the WARNING log.
func ( ...any) {
internal.LoggerV2Impl.Warning(...)
}
// Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf.
func ( string, ...any) {
internal.LoggerV2Impl.Warningf(, ...)
}
// Warningln logs to the WARNING log. Arguments are handled in the manner of fmt.Println.
func ( ...any) {
internal.LoggerV2Impl.Warningln(...)
}
// Error logs to the ERROR log.
func ( ...any) {
internal.LoggerV2Impl.Error(...)
}
// Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf.
func ( string, ...any) {
internal.LoggerV2Impl.Errorf(, ...)
}
// Errorln logs to the ERROR log. Arguments are handled in the manner of fmt.Println.
func ( ...any) {
internal.LoggerV2Impl.Errorln(...)
}
// Fatal logs to the FATAL log. Arguments are handled in the manner of fmt.Print.
// It calls os.Exit() with exit code 1.
func ( ...any) {
internal.LoggerV2Impl.Fatal(...)
// Make sure fatal logs will exit.
os.Exit(1)
}
// Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf.
// It calls os.Exit() with exit code 1.
func ( string, ...any) {
internal.LoggerV2Impl.Fatalf(, ...)
// Make sure fatal logs will exit.
os.Exit(1)
}
// Fatalln logs to the FATAL log. Arguments are handled in the manner of fmt.Println.
// It calls os.Exit() with exit code 1.
func ( ...any) {
internal.LoggerV2Impl.Fatalln(...)
// Make sure fatal logs will exit.
os.Exit(1)
}
// Print prints to the logger. Arguments are handled in the manner of fmt.Print.
//
// Deprecated: use Info.
func ( ...any) {
internal.LoggerV2Impl.Info(...)
}
// Printf prints to the logger. Arguments are handled in the manner of fmt.Printf.
//
// Deprecated: use Infof.
func ( string, ...any) {
internal.LoggerV2Impl.Infof(, ...)
}
// Println prints to the logger. Arguments are handled in the manner of fmt.Println.
//
// Deprecated: use Infoln.
func ( ...any) {
internal.LoggerV2Impl.Infoln(...)
}
// InfoDepth logs to the INFO log at the specified depth.
//
// # Experimental
//
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
// later release.
func ( int, ...any) {
if internal.DepthLoggerV2Impl != nil {
internal.DepthLoggerV2Impl.InfoDepth(, ...)
} else {
internal.LoggerV2Impl.Infoln(...)
}
}
// WarningDepth logs to the WARNING log at the specified depth.
//
// # Experimental
//
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
// later release.
func ( int, ...any) {
if internal.DepthLoggerV2Impl != nil {
internal.DepthLoggerV2Impl.WarningDepth(, ...)
} else {
internal.LoggerV2Impl.Warningln(...)
}
}
// ErrorDepth logs to the ERROR log at the specified depth.
//
// # Experimental
//
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
// later release.
func ( int, ...any) {
if internal.DepthLoggerV2Impl != nil {
internal.DepthLoggerV2Impl.ErrorDepth(, ...)
} else {
internal.LoggerV2Impl.Errorln(...)
}
}
// FatalDepth logs to the FATAL log at the specified depth.
//
// # Experimental
//
// Notice: This API is EXPERIMENTAL and may be changed or removed in a
// later release.
func ( int, ...any) {
if internal.DepthLoggerV2Impl != nil {
internal.DepthLoggerV2Impl.FatalDepth(, ...)
} else {
internal.LoggerV2Impl.Fatalln(...)
}
os.Exit(1)
}
The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64)