logs

package
v0.4.20 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.1.3

func Close()

Close 关闭日志

func Debug

func Debug(args ...interface{})

Debug 调试

func DebugContext added in v0.1.3

func DebugContext(ctx context.Context, args ...interface{})

DebugContext 调试

func DebugContextf added in v0.1.3

func DebugContextf(ctx context.Context, template string, args ...interface{})

DebugContextf 调试

func Debugf

func Debugf(template string, args ...interface{})

Debugf 调试

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

Debugw 调试

func Desugar

func Desugar() *zap.Logger

Desugar 获取底层zap.Logger

func Error

func Error(args ...interface{})

Error 错误信息

func ErrorContext added in v0.1.3

func ErrorContext(ctx context.Context, args ...interface{})

ErrorContext 错误信息

func ErrorContextf added in v0.1.3

func ErrorContextf(ctx context.Context, template string, args ...interface{})

ErrorContextf 错误信息

func Errorf

func Errorf(template string, args ...interface{})

Errorf 错误信息

func Errorw

func Errorw(msg string, keysAndValues ...interface{})

Errorw 错误信息

func Fatal

func Fatal(args ...interface{})

Fatal 致命错误

func FatalContext added in v0.1.3

func FatalContext(ctx context.Context, args ...interface{})

FatalContext 致命错误

func FatalContextf added in v0.1.3

func FatalContextf(ctx context.Context, template string, args ...interface{})

FatalContextf 致命错误

func Fatalf

func Fatalf(template string, args ...interface{})

Fatalf 致命错误

func Fatalw

func Fatalw(msg string, keysAndValues ...interface{})

Fatalw 致命错误

func Get

func Get(lgr string) *zap.SugaredLogger

Get 获取日志实例

func GetGorm

func GetGorm(lgrName string) glogger.Interface

GetGorm 获取gorm日志

func Info added in v0.1.3

func Info(args ...interface{})

Info 提示信息

func InfoContext added in v0.1.3

func InfoContext(ctx context.Context, args ...interface{})

InfoContext 提示信息

func InfoContextf added in v0.1.3

func InfoContextf(ctx context.Context, template string, args ...interface{})

InfoContextf 提示信息

func Infof

func Infof(template string, args ...interface{})

Infof 提示信息

func Infow

func Infow(msg string, keysAndValues ...interface{})

Infow 提示信息

func JSON

func JSON(v interface{}) string

JSON format to json

func LoggerFromContext added in v0.1.5

func LoggerFromContext(ctx context.Context) *zap.SugaredLogger

LoggerFromContext 获取日志上下文

func Named

func Named(name string) *zap.SugaredLogger

Named 获取并设置命名日志实例

func NewTencentClsSyncer added in v0.1.3

func NewTencentClsSyncer(cfg config.TencentCLSConfig) (zapcore.WriteSyncer, error)

NewTencentClsSyncer 阿里云日志服务

func NewWorkwxSyncer

func NewWorkwxSyncer(wxKey string) zapcore.WriteSyncer

NewWorkwxSyncer 企业微信日志

func ReloadConfig

func ReloadConfig(module string, cfg config.LogsConfig) error

ReloadConfig .

func RequestLogger

func RequestLogger(reqid string) *zap.SugaredLogger

RequestLogger 接口请求日志 需要配置access日志

func SetContextFields added in v0.1.5

func SetContextFields(ctx context.Context, fields ...interface{})

SetContextFields 设置日志上下文

func SetContextLogger added in v0.1.5

func SetContextLogger(ctx context.Context, l *zap.SugaredLogger)

SetContextLogger 设置日志上下文

func SetLevel

func SetLevel(lvl zapcore.Level)

SetLevel 设置默认日志级别

func Sync

func Sync() error

Sync 同步日志缓冲区

func Warn

func Warn(args ...interface{})

Warn 警告信息

func WarnContext added in v0.1.3

func WarnContext(ctx context.Context, args ...interface{})

WarnContext 警告信息

func WarnContextf added in v0.1.3

func WarnContextf(ctx context.Context, template string, args ...interface{})

WarnContextf 警告信息

func Warnf

func Warnf(template string, args ...interface{})

Warnf 警告信息

func Warnw

func Warnw(msg string, keysAndValues ...interface{})

Warnw 警告信息

func With

func With(args ...interface{}) *zap.SugaredLogger

With 设置日志字段, 返回一个新的日志对象,参数为键值对, 如: With("key", "value")

func WithContextFields added in v0.1.3

func WithContextFields(ctx context.Context, fields ...interface{}) context.Context

WithContextFields 设置日志字段上下文

func WithContextLogger added in v0.1.3

func WithContextLogger(ctx context.Context, l *zap.SugaredLogger) context.Context

WithContextLogger 设置日志上下文

Types

This section is empty.

Jump to

Keyboard shortcuts

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