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

package grpclog

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

Package grpclog defines logging for grpc.

All logs in transport package only go to verbose level 2. All logs in other packages in grpc are logged in spite of the verbosity level.

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.

Index

Package Files

grpclog.go logger.go loggerv2.go

func Error Uses

func Error(args ...interface{})

Error logs to the ERROR log.

func Errorf Uses

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

Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf.

func Errorln Uses

func Errorln(args ...interface{})

Errorln logs to the ERROR log. Arguments are handled in the manner of fmt.Println.

func Fatal Uses

func Fatal(args ...interface{})

Fatal logs to the FATAL log. Arguments are handled in the manner of fmt.Print. It calls os.Exit() with exit code 1.

func Fatalf Uses

func Fatalf(format string, args ...interface{})

Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf. It calles os.Exit() with exit code 1.

func Fatalln Uses

func Fatalln(args ...interface{})

Fatalln logs to the FATAL log. Arguments are handled in the manner of fmt.Println. It calle os.Exit()) with exit code 1.

func Info Uses

func Info(args ...interface{})

Info logs to the INFO log.

func Infof Uses

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

Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf.

func Infoln Uses

func Infoln(args ...interface{})

Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println.

func Print Uses

func Print(args ...interface{})

Print prints to the logger. Arguments are handled in the manner of fmt.Print.

Deprecated: use Info.

func Printf Uses

func Printf(format string, args ...interface{})

Printf prints to the logger. Arguments are handled in the manner of fmt.Printf.

Deprecated: use Infof.

func Println Uses

func Println(args ...interface{})

Println prints to the logger. Arguments are handled in the manner of fmt.Println.

Deprecated: use Infoln.

func SetLogger Uses

func SetLogger(l Logger)

SetLogger sets the logger that is used in grpc. Call only from init() functions.

Deprecated: use SetLoggerV2.

func SetLoggerV2 Uses

func SetLoggerV2(l LoggerV2)

SetLoggerV2 sets logger that is used in grpc to a V2 logger. Not mutex-protected, should be called before any gRPC functions.

func V Uses

func V(l int) bool

V reports whether verbosity level l is at least the requested verbose level.

func Warning Uses

func Warning(args ...interface{})

Warning logs to the WARNING log.

func Warningf Uses

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

Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf.

func Warningln Uses

func Warningln(args ...interface{})

Warningln logs to the WARNING log. Arguments are handled in the manner of fmt.Println.

type Logger Uses

type Logger interface {
    Fatal(args ...interface{})
    Fatalf(format string, args ...interface{})
    Fatalln(args ...interface{})
    Print(args ...interface{})
    Printf(format string, args ...interface{})
    Println(args ...interface{})
}

Logger mimics golang's standard Logger as an interface.

Deprecated: use LoggerV2.

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.

func NewLoggerV2 Uses

func NewLoggerV2(infoW, warningW, errorW io.Writer) LoggerV2

NewLoggerV2 creates a loggerV2 with the provided writers. Fatal logs will be written to errorW, warningW, infoW, followed by exit(1). Error logs will be written to errorW, warningW and infoW. Warning logs will be written to warningW and infoW. Info logs will be written to infoW.

func NewLoggerV2WithVerbosity Uses

func NewLoggerV2WithVerbosity(infoW, warningW, errorW io.Writer, v int) LoggerV2

NewLoggerV2WithVerbosity creates a loggerV2 with the provided writers and verbosity level.

Directories

PathSynopsis
gloggerPackage glogger defines glog-based logging for grpc.

Package grpclog imports 5 packages (graph) and is imported by 1463 packages. Updated 2018-09-12. Refresh now. Tools for package owners.