logging

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RPCConfig

type RPCConfig struct {
	InfoFile  string
	ErrorFile string
	Level     string
}

type RPCLogFields added in v1.0.14

type RPCLogFields struct {
	ServiceName string
	Header      http.Header
	Method      string
	URI         string
	Request     []byte
	Response    string
	ServerIP    string
	ServerPort  int
	HTTPCode    int
	Cost        int64
	Timeout     time.Duration
}

type RPCLogger

type RPCLogger struct {
	*logging.Logger
}

RPCLogger is go-redis logger Hook

func NewRPCLogger

func NewRPCLogger(cfg *RPCConfig, opts ...RPCOption) (rl *RPCLogger, err error)

NewRPCLogger

func (*RPCLogger) Error added in v1.0.14

func (rl *RPCLogger) Error(ctx context.Context, msg string, fields RPCLogFields)

func (*RPCLogger) Info added in v1.0.14

func (rl *RPCLogger) Info(ctx context.Context, msg string, fields RPCLogFields)

type RPCOption

type RPCOption func(rl *RPCLogger)

Jump to

Keyboard shortcuts

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