mylogger

package
v0.0.0-...-3122bcc Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoLogger = myerrors.NewErrorInternal("my_logger.Get для отсутствующего логгера")
)

Functions

func AddRequestIDToCtx

func AddRequestIDToCtx(ctx context.Context) context.Context

func GetRequestIDFromCtx

func GetRequestIDFromCtx(ctx context.Context) string

func GetRequestIDFromMDCtx

func GetRequestIDFromMDCtx(ctx context.Context) string

func NewMDFromRequestIDCtx

func NewMDFromRequestIDCtx(ctx context.Context) metadata.MD

func SetRequestIDToCtx

func SetRequestIDToCtx(ctx context.Context, requestID string) context.Context

Types

type MyLogger

type MyLogger struct {
	*zap.SugaredLogger
}

func Get

func Get() (*MyLogger, error)

func New

func New(outputPaths []string, errorOutputPaths []string, options ...zap.Option) (*MyLogger, error)

func NewNop

func NewNop() *MyLogger

func (*MyLogger) LogReqID

func (m *MyLogger) LogReqID(ctx context.Context) *MyLogger

Jump to

Keyboard shortcuts

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