services

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStartConsoleLog

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

NewStartConsoleLog 实例化StartConsoleLog

func NewStartCustomLog

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

func NewStartRotateLog

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

NewStartRotateLog 实例化StartRotateLog

func NewStartSingleLog

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

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

Types

type StartConsoleLog

type StartConsoleLog struct {
	StartLog
}

StartConsoleLog 代表控制台输出

type StartCustomLog

type StartCustomLog struct {
	StartLog
}

type StartLog

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

func (*StartLog) Debug

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

Debug will add debug record which contains msg and fields

func (*StartLog) Error

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

Error will add error record which contains msg and fields

func (*StartLog) Fatal

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

Fatal will add fatal record which contains msg and fields

func (*StartLog) Info

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

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

func (*StartLog) IsLevelEnable

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

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

func (*StartLog) Panic

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

Panic 输出panic的日志信息

func (*StartLog) SetCtxFielder

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

SetCtxFielder SetCxtFielder will get fields from context

func (*StartLog) SetFormatter

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

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

func (*StartLog) SetLevel

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

SetLevel set log level, and higher level will be recorded

func (*StartLog) SetOutput

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

SetOutput 设置output

func (*StartLog) Trace

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

Trace will add trace info which contains msg and fields

func (*StartLog) Warn

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

Warn will add warn record which contains msg and fields

type StartRotateLog

type StartRotateLog struct {
	StartLog
	// contains filtered or unexported fields
}

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

type StartSingleLog

type StartSingleLog struct {
	StartLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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