zaplog

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

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

func New

func New(opts ...Option) *Log

创建日志

func (*Log) Debug

func (l *Log) Debug(ctx context.Context, s string)

func (*Log) DebugO

func (l *Log) DebugO(ctx context.Context, other interface{}, s string)

func (*Log) Error

func (l *Log) Error(ctx context.Context, s string)

func (*Log) ErrorO

func (l *Log) ErrorO(ctx context.Context, other interface{}, s string)

func (*Log) Fatal

func (l *Log) Fatal(ctx context.Context, s string)

func (*Log) FatalO

func (l *Log) FatalO(ctx context.Context, other interface{}, s string)

func (*Log) Info

func (l *Log) Info(ctx context.Context, s string)

func (*Log) InfoO

func (l *Log) InfoO(ctx context.Context, other interface{}, s string)

func (*Log) Panic

func (l *Log) Panic(ctx context.Context, s string)

func (*Log) PanicO

func (l *Log) PanicO(ctx context.Context, other interface{}, s string)

func (*Log) Warn

func (l *Log) Warn(ctx context.Context, s string)

func (*Log) WarnO

func (l *Log) WarnO(ctx context.Context, other interface{}, s string)

type Option

type Option func(*Options)

func WithIsStdOut

func WithIsStdOut(isstdout string) Option

func WithLogLevel

func WithLogLevel(loglevel zapcore.Level) Option

func WithLogName

func WithLogName(logname string) Option

func WithLogPath

func WithLogPath(logpath string) Option

func WithMaxAge

func WithMaxAge(maxage int) Option

func WithMaxSize

func WithMaxSize(maxsize int) Option

func WithStacktrace

func WithStacktrace(stacktrace zapcore.Level) Option

type Options

type Options struct {
	LogPath    string        //日志保存路径
	LogName    string        //日志保存的名称,不些随机生成
	LogLevel   zapcore.Level //日志记录级别
	MaxSize    int           //日志分割的尺寸 MB
	MaxAge     int           //分割日志保存的时间 day
	Stacktrace zapcore.Level //记录堆栈的级别
	IsStdOut   string        //是否标准输出console输出
}

Jump to

Keyboard shortcuts

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