grpc: google.golang.org/grpc/internal/grpclog Index | Files

package grpclog

import "google.golang.org/grpc/internal/grpclog"

Package grpclog (internal) defines depth logging for grpc.

Index

Package Files

grpclog.go prefixLogger.go

func ErrorDepth Uses

func ErrorDepth(depth int, args ...interface{})

ErrorDepth logs to the ERROR log at the specified depth.

func FatalDepth Uses

func FatalDepth(depth int, args ...interface{})

FatalDepth logs to the FATAL log at the specified depth.

func InfoDepth Uses

func InfoDepth(depth int, args ...interface{})

InfoDepth logs to the INFO log at the specified depth.

func WarningDepth Uses

func WarningDepth(depth int, args ...interface{})

WarningDepth logs to the WARNING log at the specified depth.

type DepthLoggerV2 Uses

type DepthLoggerV2 interface {
    // InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Print.
    InfoDepth(depth int, args ...interface{})
    // WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Print.
    WarningDepth(depth int, args ...interface{})
    // ErrorDetph logs to ERROR log at the specified depth. Arguments are handled in the manner of fmt.Print.
    ErrorDepth(depth int, args ...interface{})
    // FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Print.
    FatalDepth(depth int, args ...interface{})
}

DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements DepthLoggerV2, the below functions will be called with the appropriate stack depth set for trivial functions the logger may ignore. This is a copy of the DepthLoggerV2 defined in the external grpclog package. It is defined here to avoid a circular dependency.

This API is EXPERIMENTAL.

var DepthLogger DepthLoggerV2

DepthLogger is the logger used for the depth log functions.

type LoggerV2 Uses

type LoggerV2 interface {
    // Info logs to INFO log. Arguments are handled in the manner of fmt.Print.
    Info(args ...interface{})
    // Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println.
    Infoln(args ...interface{})
    // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf.
    Infof(format string, args ...interface{})
    // Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print.
    Warning(args ...interface{})
    // Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println.
    Warningln(args ...interface{})
    // Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf.
    Warningf(format string, args ...interface{})
    // Error logs to ERROR log. Arguments are handled in the manner of fmt.Print.
    Error(args ...interface{})
    // Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println.
    Errorln(args ...interface{})
    // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
    Errorf(format string, args ...interface{})
    // Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print.
    // gRPC ensures that all Fatal logs will exit with os.Exit(1).
    // Implementations may also call os.Exit() with a non-zero exit code.
    Fatal(args ...interface{})
    // Fatalln logs to ERROR log. Arguments are handled in the manner of fmt.Println.
    // gRPC ensures that all Fatal logs will exit with os.Exit(1).
    // Implementations may also call os.Exit() with a non-zero exit code.
    Fatalln(args ...interface{})
    // Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf.
    // gRPC ensures that all Fatal logs will exit with os.Exit(1).
    // Implementations may also call os.Exit() with a non-zero exit code.
    Fatalf(format string, args ...interface{})
    // V reports whether verbosity level l is at least the requested verbose level.
    V(l int) bool
}

LoggerV2 does underlying logging work for grpclog. This is a copy of the LoggerV2 defined in the external grpclog package. It is defined here to avoid a circular dependency.

var Logger LoggerV2

Logger is the logger used for the non-depth log functions.

type PrefixLogger Uses

type PrefixLogger struct {
    // contains filtered or unexported fields
}

PrefixLogger does logging with a prefix.

Logging method on a nil logs without any prefix.

func NewPrefixLogger Uses

func NewPrefixLogger(logger DepthLoggerV2, prefix string) *PrefixLogger

NewPrefixLogger creates a prefix logger with the given prefix.

func (*PrefixLogger) Debugf Uses

func (pl *PrefixLogger) Debugf(format string, args ...interface{})

Debugf does info logging at verbose level 2.

func (*PrefixLogger) Errorf Uses

func (pl *PrefixLogger) Errorf(format string, args ...interface{})

Errorf does error logging.

func (*PrefixLogger) Infof Uses

func (pl *PrefixLogger) Infof(format string, args ...interface{})

Infof does info logging.

func (*PrefixLogger) Warningf Uses

func (pl *PrefixLogger) Warningf(format string, args ...interface{})

Warningf does warning logging.

Package grpclog imports 2 packages (graph) and is imported by 25 packages. Updated 2020-07-02. Refresh now. Tools for package owners.