services

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGinxConsoleLog

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

NewGinxConsoleLog 实例化GinxConsoleLog

func NewGinxCustomLog

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

func NewGinxRotateLog

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

NewGinxRotateLog 实例化GinxRotateLog

func NewGinxSingleLog

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

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

Types

type GinxConsoleLog

type GinxConsoleLog struct {
	GinxLog
}

GinxConsoleLog 代表控制台输出

type GinxCustomLog

type GinxCustomLog struct {
	GinxLog
}

type GinxLog

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

GinxLog 的通用实例

func (*GinxLog) Debug

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

Debug will add debug record which contains msg and fields

func (*GinxLog) Error

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

Error will add error record which contains msg and fields

func (*GinxLog) Fatal

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

Fatal will add fatal record which contains msg and fields

func (*GinxLog) Info

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

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

func (*GinxLog) IsLevelEnable

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

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

func (*GinxLog) Panic

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

Panic 输出panic的日志信息

func (*GinxLog) SetCtxFielder

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

SetCxtFielder will get fields from context

func (*GinxLog) SetFormatter

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

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

func (*GinxLog) SetLevel

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

SetLevel set log level, and higher level will be recorded

func (*GinxLog) SetOutput

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

SetOutput 设置output

func (*GinxLog) Trace

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

Trace will add trace info which contains msg and fields

func (*GinxLog) Warn

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

Warn will add warn record which contains msg and fields

type GinxRotateLog

type GinxRotateLog struct {
	GinxLog
	// contains filtered or unexported fields
}

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

type GinxSingleLog

type GinxSingleLog struct {
	GinxLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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