logger

package
v0.0.0-...-a7107f1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	GetRequestIdKey() RequestIDKeyType
	GetRequestIdFromContext(ctx context.Context) string
	StartRequest(r http.Request, requestId string)
	EndRequest(start time.Time, ctx context.Context)
	HttpInfo(ctx context.Context, msg string, status int)
	HttpLogWarning(ctx context.Context, pkg string, funcName string, warn string)
	HttpLogError(ctx context.Context, pkg string, funcName string, err error)
	HttpLogCallerError(ctx context.Context, objForPkgPath interface{}, err error)
	HttpLogInfo(ctx context.Context, msg string)
	LogError(err error, msg string)
}

type RequestIDKeyType

type RequestIDKeyType interface{}

type SimpleLogger

type SimpleLogger struct {
	*logrus.Logger
	// contains filtered or unexported fields
}

func NewJsonFormatSimpleLogger

func NewJsonFormatSimpleLogger(writer io.Writer, requestIDKey RequestIDKeyType) SimpleLogger

func NewSimpleLogger

func NewSimpleLogger(writer io.Writer, formatter logrus.Formatter, requestIDKey RequestIDKeyType) SimpleLogger

func NewTextFormatSimpleLogger

func NewTextFormatSimpleLogger(writer io.Writer, requestIDKey RequestIDKeyType) SimpleLogger

func (SimpleLogger) EndRequest

func (logger SimpleLogger) EndRequest(start time.Time, ctx context.Context)

func (SimpleLogger) GetRequestIdFromContext

func (logger SimpleLogger) GetRequestIdFromContext(ctx context.Context) string

func (SimpleLogger) GetRequestIdKey

func (logger SimpleLogger) GetRequestIdKey() RequestIDKeyType

func (SimpleLogger) HttpInfo

func (logger SimpleLogger) HttpInfo(ctx context.Context, msg string, status int)

func (SimpleLogger) HttpLogCallerError

func (logger SimpleLogger) HttpLogCallerError(ctx context.Context, objForPkgPath interface{}, err error)

func (SimpleLogger) HttpLogError

func (logger SimpleLogger) HttpLogError(ctx context.Context, pkg string, funcName string, err error)

func (SimpleLogger) HttpLogInfo

func (logger SimpleLogger) HttpLogInfo(ctx context.Context, msg string)

func (SimpleLogger) HttpLogWarning

func (logger SimpleLogger) HttpLogWarning(ctx context.Context, pkg string, funcName string, warn string)

func (SimpleLogger) LogError

func (logger SimpleLogger) LogError(err error, msg string)

func (SimpleLogger) StartRequest

func (logger SimpleLogger) StartRequest(r http.Request, requestId string)

Jump to

Keyboard shortcuts

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