logging

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnaryClientCtxIDInterceptor

func UnaryClientCtxIDInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

UnaryClientCtxIDInterceptor logs the context id from a RPC response.

func UnaryServerCtxIDInterceptor

func UnaryServerCtxIDInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

UnaryServerCtxIDInterceptor adds the ContextIDKey to the context and sets it as a log field.

Types

type ContextKey

type ContextKey string

ContextKey defines the context key type.

const ContextIDKey ContextKey = "ctx_id"

ContextIDKey holds the key of the context ID.

Jump to

Keyboard shortcuts

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