logging

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// GRPCResponseLatencyKey is the amount of time needed to produce a response to a request.
	GRPCResponseLatencyKey = "rpc.grpc.response_latency"
)

Variables

This section is empty.

Functions

func StreamServerInterceptor

func StreamServerInterceptor(logger Logger) grpc.StreamServerInterceptor

StreamServerInterceptor returns a new stream interceptor suitable for request logging.

func UnaryServerInterceptor

func UnaryServerInterceptor(logger Logger) grpc.UnaryServerInterceptor

UnaryServerInterceptor returns a new unary interceptor suitable for request logging.

Types

type Logger

type Logger interface {
	// Debug logs debug data.
	Debug(ctx context.Context, msg string, args ...interface{})

	// Info logs info data.
	Info(ctx context.Context, msg string, args ...interface{})

	// Warning logs warning data.
	Warning(ctx context.Context, msg string, args ...interface{})

	// Error logs error data.
	Error(ctx context.Context, err error)

	// Critical logs critical data.
	Critical(ctx context.Context, err error)

	// Fatal logs critical data and exists current program execution.
	Fatal(ctx context.Context, err error)
}

Logger defines how the application logs data into the system

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL