logx

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogxContext ContextKey = "logx-context"
	UrlPath     string     = "url.path"
	UrlMethod   string     = "url.method"
	UrlPattern  string     = "url.pattern"
)

Variables

This section is empty.

Functions

func ChiLoggerRequest

func ChiLoggerRequest(next http.Handler) http.Handler

func FromCtx

func FromCtx(ctx context.Context) logrus.FieldLogger

LoggerFromCtx if not exist will panic

func Init

func Init(c Config) logrus.FieldLogger

func InjectCtx

func InjectCtx(ctx context.Context, logger logrus.FieldLogger) context.Context

func SessionLogger

func SessionLogger(logger logrus.FieldLogger) func(next http.Handler) http.Handler

Types

type Config

type Config struct {
	ServiceName  string
	Env          string
	MinimalLevel logrus.Level
	Output       io.Writer
}

type ContextKey

type ContextKey string

Jump to

Keyboard shortcuts

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