services

package
v0.0.0-...-8d54ad1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebgoConsoleLog

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

NewWebgoConsoleLog 实例化WebgoConsoleLog

func NewWebgoCustomLog

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

func NewWebgoRotateLog

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

NewWebgoRotateLog 实例化WebgoRotateLog

func NewWebgoSingleLog

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

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

Types

type WebgoConsoleLog

type WebgoConsoleLog struct {
	WebgoLog
}

WebgoConsoleLog 代表控制台输出

type WebgoCustomLog

type WebgoCustomLog struct {
	WebgoLog
}

type WebgoLog

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

WebgoLog 的通用实例

func (*WebgoLog) Debug

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

Debug will add debug record which contains msg and fields

func (*WebgoLog) Error

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

Error will add error record which contains msg and fields

func (*WebgoLog) Fatal

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

Fatal will add fatal record which contains msg and fields

func (*WebgoLog) Info

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

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

func (*WebgoLog) IsLevelEnable

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

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

func (*WebgoLog) Panic

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

Panic 输出panic的日志信息

func (*WebgoLog) SetCtxFielder

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

SetCxtFielder will get fields from context

func (*WebgoLog) SetFormatter

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

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

func (*WebgoLog) SetLevel

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

SetLevel set log level, and higher level will be recorded

func (*WebgoLog) SetOutput

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

SetOutput 设置output

func (*WebgoLog) Trace

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

Trace will add trace info which contains msg and fields

func (*WebgoLog) Warn

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

Warn will add warn record which contains msg and fields

type WebgoRotateLog

type WebgoRotateLog struct {
	WebgoLog
	// contains filtered or unexported fields
}

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

type WebgoSingleLog

type WebgoSingleLog struct {
	WebgoLog
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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