logger

package
v0.0.0-...-2917517 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

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

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 OCMLogger

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

func NewOCMLogger

func NewOCMLogger(ctx context.Context) OCMLogger

NewOCMLogger creates a new logger instance with a default verbosity of 1

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