services

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNiceConsoleLog

func NewNiceConsoleLog(params ...interface{}) (interface{}, error)

NewNiceConsoleLog 实例化NiceConsoleLog

func NewNiceCustomLog

func NewNiceCustomLog(params ...interface{}) (interface{}, error)

func NewNiceRotateLog

func NewNiceRotateLog(params ...interface{}) (interface{}, error)

NewNiceRotateLog 实例化NiceRotateLog

func NewNiceSingleLog

func NewNiceSingleLog(params ...interface{}) (interface{}, error)

NewNiceSingleLog params sequence: level, ctxFielder, Formatter, map[string]interface(folder/file)

Types

type NiceConsoleLog

type NiceConsoleLog struct {
	NiceLog
}

NiceConsoleLog 代表控制台输出

type NiceCustomLog

type NiceCustomLog struct {
	NiceLog
}

type NiceLog

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

NiceLog 的通用实例

func (*NiceLog) Debug

func (log *NiceLog) Debug(ctx context.Context, msg string, fields map[string]interface{})

Debug will add debug record which contains msg and fields

func (*NiceLog) Error

func (log *NiceLog) Error(ctx context.Context, msg string, fields map[string]interface{})

Error will add error record which contains msg and fields

func (*NiceLog) Fatal

func (log *NiceLog) Fatal(ctx context.Context, msg string, fields map[string]interface{})

Fatal will add fatal record which contains msg and fields

func (*NiceLog) Info

func (log *NiceLog) Info(ctx context.Context, msg string, fields map[string]interface{})

Info 会打印出普通的日志信息

func (*NiceLog) IsLevelEnable

func (log *NiceLog) IsLevelEnable(level contract.LogLevel) bool

IsLevelEnable 判断这个级别是否可以打印

func (*NiceLog) Panic

func (log *NiceLog) Panic(ctx context.Context, msg string, fields map[string]interface{})

Panic 输出panic的日志信息

func (*NiceLog) SetCtxFielder

func (log *NiceLog) SetCtxFielder(handler contract.CtxFielder)

SetCxtFielder will get fields from context

func (*NiceLog) SetFormatter

func (log *NiceLog) SetFormatter(formatter contract.Formatter)

SetFormatter will set formatter handler will covert data to string for recording

func (*NiceLog) SetLevel

func (log *NiceLog) SetLevel(level contract.LogLevel)

SetLevel set log level, and higher level will be recorded

func (*NiceLog) SetOutput

func (log *NiceLog) SetOutput(output io.Writer)

SetOutput 设置output

func (*NiceLog) Trace

func (log *NiceLog) Trace(ctx context.Context, msg string, fields map[string]interface{})

Trace will add trace info which contains msg and fields

func (*NiceLog) Warn

func (log *NiceLog) Warn(ctx context.Context, msg string, fields map[string]interface{})

Warn will add warn record which contains msg and fields

type NiceRotateLog

type NiceRotateLog struct {
	NiceLog
	// contains filtered or unexported fields
}

NiceRotateLog 代表会进行切割的日志文件存储

type NiceSingleLog

type NiceSingleLog struct {
	NiceLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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