logger

package
v0.0.0-...-2ebd195 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext

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

FromContext gets the logger from the context.

func InitLumberjack

func InitLumberjack(config *config.LogConfig) *lumberjack.Logger

func NewContext

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

NewContext returns a new context that contains the logger.

Types

type LogConfig

type LogConfig struct {
	ServiceName string //服务名
	LogPath     string
}

func (*LogConfig) CreateNewLogger

func (c *LogConfig) CreateNewLogger(config *config.LogConfig) (*zap.Logger, error)

type ZapLogger

type ZapLogger struct {
	// contains filtered or unexported fields
}

func NewZapLogger

func NewZapLogger(logger *zap.Logger) *ZapLogger

func (*ZapLogger) Error

func (l *ZapLogger) Error(args ...interface{})

func (*ZapLogger) Errorf

func (l *ZapLogger) Errorf(format string, args ...interface{})

func (*ZapLogger) Errorln

func (l *ZapLogger) Errorln(args ...interface{})

func (*ZapLogger) Fatal

func (l *ZapLogger) Fatal(args ...interface{})

func (*ZapLogger) Fatalf

func (l *ZapLogger) Fatalf(format string, args ...interface{})

func (*ZapLogger) Fatalln

func (l *ZapLogger) Fatalln(args ...interface{})

func (*ZapLogger) Info

func (l *ZapLogger) Info(args ...interface{})

func (*ZapLogger) Infof

func (l *ZapLogger) Infof(format string, args ...interface{})

func (*ZapLogger) Infoln

func (l *ZapLogger) Infoln(args ...interface{})

func (*ZapLogger) V

func (l *ZapLogger) V(v int) bool

func (*ZapLogger) Warning

func (l *ZapLogger) Warning(args ...interface{})

func (*ZapLogger) Warningf

func (l *ZapLogger) Warningf(format string, args ...interface{})

func (*ZapLogger) Warningln

func (l *ZapLogger) Warningln(args ...interface{})

Jump to

Keyboard shortcuts

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