golog

package
v1.0.162 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 27 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   // 显示代码行
}

type ApiSLogFun added in v1.0.162

type ApiSLogFun func() *ApiSLog

type ApiZapLog added in v1.0.141

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

func NewApiZapLog added in v1.0.141

func NewApiZapLog(ctx context.Context, config *ApiZapLogConfig) *ApiZapLog

func (*ApiZapLog) Middleware added in v1.0.141

func (zl *ApiZapLog) Middleware(ctx context.Context, request gorequest.Response)

Middleware 中间件

func (*ApiZapLog) MiddlewareCustom added in v1.0.141

func (zl *ApiZapLog) MiddlewareCustom(ctx context.Context, api string, request gorequest.Response)

MiddlewareCustom 中间件

func (*ApiZapLog) MiddlewareXml added in v1.0.141

func (zl *ApiZapLog) MiddlewareXml(ctx context.Context, request gorequest.Response)

MiddlewareXml 中间件

type ApiZapLogConfig added in v1.0.141

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

type ApiZapLogFun added in v1.0.141

type ApiZapLogFun func() *ApiZapLog

ApiZapLogFun *ApiClient 驱动

type ConfigGinCustomClient added in v1.0.113

type ConfigGinCustomClient struct {
	IpService     *goip.Client            // ip服务
	GormClientFun dorm.GormClientTableFun // 日志配置
	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(config *GinClientConfig) (*GinClient, error)

NewGinClient 创建框架实例化

func (*GinClient) GormCustomTableDelete added in v1.0.69

func (c *GinClient) GormCustomTableDelete(ctx context.Context, tableName string, hour int64) error

GormCustomTableDelete 删除数据 - 自定义表名

func (*GinClient) GormDelete added in v1.0.52

func (c *GinClient) GormDelete(ctx context.Context, hour int64) error

GormDelete 删除

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服务
	GormClientFun dorm.GormClientTableFun // 日志配置
	ZapLog        *ZapLog                 // 日志服务
	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(config *ConfigGinCustomClient) (*GinCustomClient, error)

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() error

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 LoggerOperation added in v1.0.162

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

func (*LoggerOperation) Debug added in v1.0.162

func (l *LoggerOperation) Debug(msg string, args ...any)

Debug logs at LevelDebug.

func (*LoggerOperation) DebugContext added in v1.0.162

func (l *LoggerOperation) DebugContext(ctx context.Context, msg string, args ...any)

DebugContext logs at LevelDebug with the given context.

func (*LoggerOperation) Debugf added in v1.0.162

func (l *LoggerOperation) Debugf(template string, args ...any)

Debugf formats the message according to the format specifier

func (*LoggerOperation) Error added in v1.0.162

func (l *LoggerOperation) Error(msg string, args ...any)

Error logs at LevelError.

func (*LoggerOperation) ErrorContext added in v1.0.162

func (l *LoggerOperation) ErrorContext(ctx context.Context, msg string, args ...any)

ErrorContext logs at LevelError with the given context.

func (*LoggerOperation) Errorf added in v1.0.162

func (l *LoggerOperation) Errorf(template string, args ...any)

Errorf formats the message according to the format specifier

func (*LoggerOperation) Info added in v1.0.162

func (l *LoggerOperation) Info(msg string, args ...any)

Info logs at LevelInfo.

func (*LoggerOperation) InfoContext added in v1.0.162

func (l *LoggerOperation) InfoContext(ctx context.Context, msg string, args ...any)

InfoContext logs at LevelInfo with the given context.

func (*LoggerOperation) Infof added in v1.0.162

func (l *LoggerOperation) Infof(template string, args ...any)

Infof formats the message according to the format specifier

func (*LoggerOperation) Warn added in v1.0.162

func (l *LoggerOperation) Warn(msg string, args ...any)

Warn logs at LevelWarn.

func (*LoggerOperation) WarnContext added in v1.0.162

func (l *LoggerOperation) WarnContext(ctx context.Context, msg string, args ...any)

func (*LoggerOperation) Warnf added in v1.0.162

func (l *LoggerOperation) Warnf(template string, args ...any)

Warnf formats the message according to the format specifier

type SLog added in v1.0.162

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

func NewSlog added in v1.0.162

func NewSlog(config *SLogConfig) *SLog

func (*SLog) WithLogger added in v1.0.162

func (sl *SLog) WithLogger() *LoggerOperation

WithLogger 跟踪编号

func (*SLog) WithTraceId added in v1.0.162

func (sl *SLog) WithTraceId(ctx context.Context) *LoggerOperation

WithTraceId 跟踪编号

func (*SLog) WithTraceIdStr added in v1.0.162

func (sl *SLog) WithTraceIdStr(traceId string) *LoggerOperation

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   // 显示代码行
	LogInConsole bool   // 是否同时输出到控制台
}

type ZapLog added in v1.0.52

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

func NewZapLog added in v1.0.52

func NewZapLog(config *ZapLogConfig) *ZapLog

func (*ZapLog) WithLogger added in v1.0.52

func (zl *ZapLog) WithLogger() *zap.Logger

WithLogger 跟踪编号

func (*ZapLog) WithTraceId added in v1.0.52

func (zl *ZapLog) WithTraceId(ctx context.Context) *zap.Logger

WithTraceId 跟踪编号

func (*ZapLog) WithTraceIdStr added in v1.0.52

func (zl *ZapLog) WithTraceIdStr(traceId string) *zap.Logger

WithTraceIdStr 跟踪编号

type ZapLogConfig added in v1.0.52

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

type ZapLogFun added in v1.0.141

type ZapLogFun func() *ZapLog

ZapLogFun *ApiClient 驱动

Jump to

Keyboard shortcuts

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