aliSLS

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSLSHandler

func GetSLSHandler(level golog.Level) (handler func(l *golog.Log) bool, err error)

Types

type GormSLSLogger added in v1.0.10

type GormSLSLogger interface {
	GormSuccessCallback(sql string, source string, rows int, duration float64)
	GormFailCallback(source string, msg ...interface{})
}

func NewGormSLSLogger added in v1.0.10

func NewGormSLSLogger(agent SLSAgent) GormSLSLogger

type SLSAgent

type SLSAgent interface {
	// 发送自定义日志
	SendCustomize(contents []*sls.LogContent) error
	// 发送自定义map
	SendCustomizeMap(mapContents map[string]string) error
	// 发送日志
	Send(contents []*sls.LogContent, skip ...int) (err error)
	// 发送map
	SendMap(mapContents map[string]string) (err error)
	// 带超时的关闭
	Close(timeoutMs int64) error
	// 安全关闭
	SafeClose()
}

func GetSLS

func GetSLS(endpoint, keyID, keySecret, project, logStore, topic, source string) SLSAgent

Jump to

Keyboard shortcuts

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