services

package
v0.0.0-...-ed6a5cb Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewColonConsoleLog

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

NewColonConsoleLog 实例化ColonConsoleLog

func NewColonCustomLog

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

func NewColonRotateLog

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

NewColonRotateLog 实例化ColonRotateLog

func NewColonSingleLog

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

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

Types

type ColonConsoleLog

type ColonConsoleLog struct {
	ColonLog
}

ColonConsoleLog 控制台输出

type ColonCustomLog

type ColonCustomLog struct {
	ColonLog
}

type ColonLog

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

ColonLog 的通用实例

func (*ColonLog) Debug

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

Debug will add debug record which contains msg and fields

func (*ColonLog) Error

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

Error will add error record which contains msg and fields

func (*ColonLog) Fatal

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

Fatal will add fatal record which contains msg and fields

func (*ColonLog) Info

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

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

func (*ColonLog) IsLevelEnable

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

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

func (*ColonLog) Panic

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

Panic 输出panic的日志信息

func (*ColonLog) SetCtxFielder

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

SetCxtFielder will get fields from context

func (*ColonLog) SetFormatter

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

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

func (*ColonLog) SetLevel

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

SetLevel set log level, and higher level will be recorded

func (*ColonLog) SetOutput

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

SetOutput 设置output

func (*ColonLog) Trace

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

Trace will add trace info which contains msg and fields

func (*ColonLog) Warn

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

Warn will add warn record which contains msg and fields

type ColonRotateLog

type ColonRotateLog struct {
	ColonLog
	// contains filtered or unexported fields
}

ColonRotateLog 会进行切割的日志文件存储

type ColonSingleLog

type ColonSingleLog struct {
	ColonLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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