logger

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimestampFormat = "2006/01/02 - 15:04:05"
)

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) *handlerLogger

func GetFormat

func GetFormat() string

func GetFormatter

func GetFormatter() logrus.Formatter

func GrpcLogger

func GrpcLogger(opts ...HandlerLogOption) grpc.UnaryServerInterceptor

func New

func New() *logrus.Logger

func NewGorm

func NewGorm(opts ...GormOption) *gormLogger

func NewHandlerLogger

func NewHandlerLogger() *handlerLogger

func RestLogger

func RestLogger(opts ...HandlerLogOption) gin.HandlerFunc

func SetFormatter

func SetFormatter(log *logrus.Logger)

func ToContext

func ToContext(ctx context.Context, log *handlerLogger) context.Context

func WithDebug

func WithDebug(conf *config)

Types

type GormOption

type GormOption func(conf *config)

func WithTimeFormat

func WithTimeFormat(timeFmt string) GormOption

type HandlerLogOption

type HandlerLogOption func(conf *handlerLogConfig)

func WithGinDebug

func WithGinDebug(level logrus.Level) HandlerLogOption

Jump to

Keyboard shortcuts

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