services

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewYogoConsoleLog

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

NewYogoConsoleLog 实例化YogoConsoleLog

func NewYogoCustomLog

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

func NewYogoRotateLog

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

NewYogoRotateLog 实例化YogoRotateLog

func NewYogoSingleLog

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

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

Types

type YogoConsoleLog

type YogoConsoleLog struct {
	YogoLog
}

YogoConsoleLog 代表控制台输出

type YogoCustomLog

type YogoCustomLog struct {
	YogoLog
}

type YogoLog

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

YogoLog 的通用实例

func (*YogoLog) Debug

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

Debug will add debug record which contains msg and fields

func (*YogoLog) Error

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

Error will add error record which contains msg and fields

func (*YogoLog) Fatal

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

Fatal will add fatal record which contains msg and fields

func (*YogoLog) Info

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

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

func (*YogoLog) IsLevelEnable

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

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

func (*YogoLog) Panic

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

Panic 输出panic的日志信息

func (*YogoLog) SetCtxFielder

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

SetCxtFielder will get fields from context

func (*YogoLog) SetFormatter

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

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

func (*YogoLog) SetLevel

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

SetLevel set log level, and higher level will be recorded

func (*YogoLog) SetOutput

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

SetOutput 设置output

func (*YogoLog) Trace

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

Trace will add trace info which contains msg and fields

func (*YogoLog) Warn

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

Warn will add warn record which contains msg and fields

type YogoRotateLog

type YogoRotateLog struct {
	YogoLog
	// contains filtered or unexported fields
}

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

type YogoSingleLog

type YogoSingleLog struct {
	YogoLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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