logger

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecCloser

type ExecCloser interface {
	Exec(entry *zapcore.Entry, m map[string]interface{}) error
	Close() error
}

func NewExec

func NewExec(sess qmgo.Database, dbName, cName string) ExecCloser

type FilterHandle

type FilterHandle func(m map[string]interface{}) map[string]interface{}

type MongoHook

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

func NewMongoHook

func NewMongoHook(opt ...MongoHookOption) *MongoHook

func (*MongoHook) Fire

func (this *MongoHook) Fire(entry *zapcore.Entry, m map[string]interface{}) error

func (*MongoHook) Flush

func (this *MongoHook) Flush()

等待直到队列为空

func (*MongoHook) Level

func (this *MongoHook) Level() zapcore.Level

func (*MongoHook) WriteConsole

func (this *MongoHook) WriteConsole(ent zapcore.Entry, p []byte) error

func (*MongoHook) WriteJson

func (this *MongoHook) WriteJson(ent zapcore.Entry, p []byte) error

func (*MongoHook) WriteObject

func (this *MongoHook) WriteObject(ent zapcore.Entry, m map[string]interface{}) error

type MongoHookOption

type MongoHookOption func(*mongoHookOpt)

func SetExec

func SetExec(exec ExecCloser) MongoHookOption

func SetExtra

func SetExtra(extra map[string]interface{}) MongoHookOption

设置额外的Field

func SetFilter

func SetFilter(filter FilterHandle) MongoHookOption

设置过滤器

func SetLevels

func SetLevels(level zapcore.Level) MongoHookOption

设置日志级别

func SetMaxQueues

func SetMaxQueues(maxQueues int) MongoHookOption

设置队列数量

func SetMaxWorkers

func SetMaxWorkers(maxWorkers int) MongoHookOption

设置Worker数量

func SetOut

func SetOut(out io.Writer) MongoHookOption

设置额外输出流

Jump to

Keyboard shortcuts

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