golog

package
v1.0.195 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiSLog added in v1.0.162

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

func NewApiSlog added in v1.0.162

func NewApiSlog(ctx context.Context, config *ApiSLogConfig) *ApiSLog

func (*ApiSLog) Middleware added in v1.0.162

func (sl *ApiSLog) Middleware(ctx context.Context, request gorequest.Response)

Middleware 中间件

func (*ApiSLog) MiddlewareCustom added in v1.0.162

func (sl *ApiSLog) MiddlewareCustom(ctx context.Context, api string, request gorequest.Response)

MiddlewareCustom 中间件

func (*ApiSLog) MiddlewareXml added in v1.0.162

func (sl *ApiSLog) MiddlewareXml(ctx context.Context, request gorequest.Response)

MiddlewareXml 中间件

type ApiSLogConfig added in v1.0.162

type ApiSLogConfig struct {
	LogPath     string // 日志文件路径
	LogName     string // 日志文件名
	MaxSize     int    // 单位为MB,默认为512MB
	MaxBackups  int    // 保留旧文件的最大个数
	MaxAge      int    // 文件最多保存多少天 0=不删除
	LocalTime   bool   // 采用本地时间
	Compress    bool   // 是否压缩日志
	ShowLine    bool   // 显示代码行
	LogSaveFile bool   // 是否保存到文件
}

type ApiSLogFun added in v1.0.162

type ApiSLogFun func() *ApiSLog

type ConfigGinCustomClient added in v1.0.113

type ConfigGinCustomClient struct {
	IpService *goip.Client // IP服务
	CurrentIp string       // 当前IP
}

type GinClient added in v1.0.47

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

GinClient 框架

func NewGinClient added in v1.0.47

func NewGinClient(ctx context.Context, config *GinClientConfig) (*GinClient, error)

NewGinClient 创建框架实例化

func (*GinClient) ConfigSLogClientFun added in v1.0.163

func (c *GinClient) ConfigSLogClientFun(sLogFun SLogFun)

ConfigSLogClientFun 日志配置

func (*GinClient) Middleware added in v1.0.52

func (c *GinClient) Middleware() gin.HandlerFunc

Middleware 中间件

type GinClientConfig added in v1.0.52

type GinClientConfig struct {
	IpService *goip.Client // IP服务
	CurrentIp string       // 当前IP
}

GinClientConfig 框架实例配置

type GinClientFun added in v1.0.52

type GinClientFun func() *GinClient

GinClientFun *GinClient 驱动

type GinCustomClient added in v1.0.113

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

func NewGinCustomClient added in v1.0.113

func NewGinCustomClient(ctx context.Context, config *ConfigGinCustomClient) (*GinCustomClient, error)

func (*GinCustomClient) ConfigSLogClientFun added in v1.0.164

func (c *GinCustomClient) ConfigSLogClientFun(sLogFun SLogFun)

ConfigSLogClientFun 日志配置

func (*GinCustomClient) GinRecord added in v1.0.113

GinRecord 记录日志

type GinCustomClientGinRecordOperation added in v1.0.113

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

func (*GinCustomClientGinRecordOperation) CreateData added in v1.0.113

func (o *GinCustomClientGinRecordOperation) CreateData()

func (*GinCustomClientGinRecordOperation) CreateDataNoError added in v1.0.113

func (o *GinCustomClientGinRecordOperation) CreateDataNoError()

func (*GinCustomClientGinRecordOperation) CustomInfo added in v1.0.113

func (o *GinCustomClientGinRecordOperation) CustomInfo(customId any, customType any, customContent any) *GinCustomClientGinRecordOperation

type SLog added in v1.0.162

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

func NewSlog added in v1.0.162

func NewSlog(ctx context.Context, config *SLogConfig) *SLog

func (*SLog) WithLogger added in v1.0.162

func (sl *SLog) WithLogger() *slog.Logger

WithLogger 跟踪编号

func (*SLog) WithTraceId added in v1.0.162

func (sl *SLog) WithTraceId(ctx context.Context) *slog.Logger

WithTraceId 跟踪编号

func (*SLog) WithTraceIdStr added in v1.0.162

func (sl *SLog) WithTraceIdStr(traceId string) *slog.Logger

WithTraceIdStr 跟踪编号

type SLogConfig added in v1.0.162

type SLogConfig struct {
	LogPath      string // 日志文件路径
	LogName      string // 日志文件名
	MaxSize      int    // 单位为MB,默认为512MB
	MaxBackups   int    // 保留旧文件的最大个数
	MaxAge       int    // 文件最多保存多少天 0=不删除
	LocalTime    bool   // 采用本地时间
	Compress     bool   // 是否压缩日志
	JsonFormat   bool   // 是否输出为json格式
	ShowLine     bool   // 显示代码行
	LogSaveFile  bool   // 是否保存到文件
	LogInConsole bool   // 是否同时输出到控制台
}

type SLogFun added in v1.0.163

type SLogFun func() *SLog

Jump to

Keyboard shortcuts

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