services

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOneConsoleLog

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

func NewOneCustomLog

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

func NewOneRotateLog

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

NewHadeRotateLog 实例化HadeRotateLog

func NewOneSingleLog

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

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

Types

type OneConsoleLog

type OneConsoleLog struct {
	OneLog
}

type OneCustomLog

type OneCustomLog struct {
	OneLog
}

type OneLog

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

func (*OneLog) Debug

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

Debug will add debug record which contains msg and fields

func (*OneLog) Error

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

Error will add error record which contains msg and fields

func (*OneLog) Fatal

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

Fatal will add fatal record which contains msg and fields

func (*OneLog) Info

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

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

func (*OneLog) IsLevelEnable

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

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

func (*OneLog) Panic

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

Panic 输出panic的日志信息

func (*OneLog) SetCtxFielder

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

SetCxtFielder will get fields from context

func (*OneLog) SetFormatter

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

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

func (*OneLog) SetLevel

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

SetLevel set log level, and higher level will be recorded

func (*OneLog) SetOutput

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

SetOutput 设置output

func (*OneLog) Trace

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

Trace will add trace info which contains msg and fields

func (*OneLog) Warn

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

Warn will add warn record which contains msg and fields

type OneRotateLog

type OneRotateLog struct {
	OneLog
	// contains filtered or unexported fields
}

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

type OneSingleLog

type OneSingleLog struct {
	OneLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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