service

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewYgoConsoleLog

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

NewYgoConsoleLog 实例化YgoConsoleLog

func NewYgoCustomLog

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

func NewYgoRotateLog

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

NewHadeRotateLog 实例化HadeRotateLog

func NewYgoSingleLog

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

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

Types

type YgoConsoleLog

type YgoConsoleLog struct {
	YgoLog
}

type YgoCustomLog

type YgoCustomLog struct {
	YgoLog
}

type YgoLog

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

func (*YgoLog) Debug

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

Debug will add debug record which contains msg and fields

func (*YgoLog) Error

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

Error will add error record which contains msg and fields

func (*YgoLog) Fatal

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

Fatal will add fatal record which contains msg and fields

func (*YgoLog) Info

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

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

func (*YgoLog) IsLevelEnable

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

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

func (*YgoLog) Panic

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

Panic 输出panic的日志信息

func (*YgoLog) SetCtxFielder

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

SetCxtFielder will get fields from context

func (*YgoLog) SetFormatter

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

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

func (*YgoLog) SetLevel

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

SetLevel set log level, and higher level will be recorded

func (*YgoLog) SetOutput

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

SetOutput 设置output

func (*YgoLog) Trace

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

Trace will add trace info which contains msg and fields

func (*YgoLog) Warn

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

Warn will add warn record which contains msg and fields

type YgoRotateLog

type YgoRotateLog struct {
	YgoLog
	// contains filtered or unexported fields
}

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

type YgoSingleLog

type YgoSingleLog struct {
	YgoLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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