logger

package
v0.1.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TagKeyMain     = "main"
	TagKeyRecovery = "recovery"
	TagKeyRequest  = "request"
	TagKeyLogin    = "login"
	TagKeyLogout   = "logout"
	TagKeySystem   = "system"
	TagKeyOperate  = "operate"
)

Variables

This section is empty.

Functions

func Context

func Context(ctx context.Context) *zap.Logger

func FromLogger

func FromLogger(ctx context.Context) *zap.Logger

func FromStack

func FromStack(ctx context.Context) error

func FromTag

func FromTag(ctx context.Context) string

func FromTraceId

func FromTraceId(ctx context.Context) string

func FromUserId

func FromUserId(ctx context.Context) string

func Init

func Init(ctx context.Context) (func(), error)

func InitWithConfig

func InitWithConfig(ctx context.Context) (func(), error)

func NewLogger

func NewLogger(ctx context.Context, logger *zap.Logger) context.Context

func NewStack

func NewStack(ctx context.Context, stack error) context.Context

func NewTag

func NewTag(ctx context.Context, tag string) context.Context

func NewTraceId

func NewTraceId(ctx context.Context, traceId string) context.Context

func NewUserId

func NewUserId(ctx context.Context, userId string) context.Context

Types

type PrintLogger

type PrintLogger struct{}

func (*PrintLogger) Printf

func (l *PrintLogger) Printf(format string, args ...any)

Jump to

Keyboard shortcuts

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