ezap

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logfile   *os.File
	ZapConfig zap.Config
	MaxAge    int64 //定期清理日志文件,日志保留天数
}

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig default config ...

type Ezap

type Ezap struct {
	logx.GLog
	Logger  *zap.Logger
	Logfile *os.File
	Config  *Config
}

Ezap 将文件输出到终端或者文件

func NewConsoleEzap

func NewConsoleEzap() *Ezap

func NewFileEzap

func NewFileEzap(path ...string) *Ezap

func (*Ezap) DebugCtx

func (e *Ezap) DebugCtx(ctx context.Context, msg string, fields ...zap.Field)

func (*Ezap) ErrorCtx

func (e *Ezap) ErrorCtx(ctx context.Context, msg string, fields ...zap.Field)

func (*Ezap) InfoCtx

func (e *Ezap) InfoCtx(ctx context.Context, msg string, fields ...zap.Field)

func (*Ezap) WarnCtx

func (e *Ezap) WarnCtx(ctx context.Context, msg string, fields ...zap.Field)

Jump to

Keyboard shortcuts

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