logger

package
v0.0.27 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOperationID

func GetOperationID(ctx context.Context) string

GetOperationID get operationID of the context

func OperationIDMiddleware

func OperationIDMiddleware(handler http.Handler) http.Handler

OperationIDMiddleware Middleware wraps the given HTTP handler so that the details of the request are sent to the log.

func WithOpID

func WithOpID(ctx context.Context) context.Context

Types

type Logger added in v0.0.3

type Logger interface {
	V(level int32) Logger
	Infof(format string, args ...interface{})
	Extra(key string, value interface{}) Logger
	Info(message string)
	Warning(message string)
	Error(message string)
	Fatal(message string)
}

func NewLogger added in v0.0.3

func NewLogger(ctx context.Context) Logger

type OperationIDKey

type OperationIDKey string
const OpIDHeader OperationIDKey = "X-Operation-ID"
const OpIDKey OperationIDKey = "opID"

Jump to

Keyboard shortcuts

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