services

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGocoreConsoleLog

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

NewGocoreConsoleLog 实例化GocoreConsoleLog

func NewGocoreCustomLog

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

func NewGocoreRotateLog

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

func NewGocoreSingleLog

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

Types

type GocoreConsoleLog

type GocoreConsoleLog struct {
	GocoreLog
}

GocoreConsoleLog 代表控制台数输出

type GocoreCustomLog

type GocoreCustomLog struct {
	GocoreLog
}

type GocoreLog

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

GocoreLog log的通用结构

func (*GocoreLog) Debug

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

Debug will add debug record which contains msg and fields

func (*GocoreLog) Error

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

Error will add error record which contains msg and fields

func (*GocoreLog) Fatal

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

Fatal will add fatal record which contains msg and fields

func (*GocoreLog) Info

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

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

func (*GocoreLog) IsLevelEnable

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

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

func (*GocoreLog) Panic

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

Panic 输出panic的日志信息

func (*GocoreLog) SetCtxFielder

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

SetCtxFielder will get fields from context

func (*GocoreLog) SetFormatter

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

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

func (*GocoreLog) SetLevel

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

SetLevel set log level, and higher level will be recorded

func (*GocoreLog) SetOutput

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

func (*GocoreLog) Trace

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

Trace will add trace info which contains msg and fields

func (*GocoreLog) Warn

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

Warn will add warn record which contains msg and fields

type GocoreRotateLog

type GocoreRotateLog struct {
	GocoreLog
	// contains filtered or unexported fields
}

type GocoreSingleLog

type GocoreSingleLog struct {
	GocoreLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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