logx

package
v1.2.56 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: MIT Imports: 26 Imported by: 8

Documentation

Index

Constants

View Source
const (
	DebugLevel  = zapcore.DebugLevel
	InfoLevel   = zapcore.InfoLevel
	WarnLevel   = zapcore.WarnLevel
	ErrorLevel  = zapcore.ErrorLevel
	DPanicLevel = zapcore.DPanicLevel
	PanicLevel  = zapcore.PanicLevel
	FatalLevel  = zapcore.FatalLevel
)

Variables

This section is empty.

Functions

func DPanic

func DPanic(args ...interface{})

func Debug

func Debug(args ...interface{})

func Error

func Error(args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Format

func Format(value ...interface{}) string

func GetWriter

func GetWriter() io.Writer

func GinLogger

func GinLogger() gin.HandlerFunc

GinLogger 接收gin框架默认的日志

func GinRecovery

func GinRecovery(stack bool) gin.HandlerFunc

GinRecovery recover掉项目可能出现的panic,并使用zap记录相关日志

func Info

func Info(args ...interface{})

func InitLogger

func InitLogger(filename string, level zapcore.Level)

InitLogger level: debug,info,warn,error,panic,fatal

func InitLoggerWithMQ added in v1.2.50

func InitLoggerWithMQ(level zapcore.Level)

InitLoggerWithMQ 初始化日志 level: debug,info,warn,error,panic,fatal

func InitLoggerWithOutFile

func InitLoggerWithOutFile(level zapcore.Level)

func KratosServer

func KratosServer(logger klog.Logger) middleware.Middleware

KratosServer is an server logging middleware.

func NewKratosLogger

func NewKratosLogger(logger *Logger) klog.Logger

NewKratosLogger returns a new kratos logger

func Panic

func Panic(args ...interface{})

func Recovery

func Recovery()

Recovery recover掉项目可能出现的panic,并使用zap记录相关日志

func Warn

func Warn(args ...interface{})

Types

type CommonLogger

type CommonLogger struct {
	Logger
}

CommonLogger fmgo内部通用日志接口

func NewCommonLogger

func NewCommonLogger(logger *Logger) CommonLogger

NewCommonLogger 创建一个通用日志对象

func (CommonLogger) DPanic

func (l CommonLogger) DPanic(args ...interface{})

func (CommonLogger) Debug

func (l CommonLogger) Debug(args ...interface{})

func (CommonLogger) Error

func (l CommonLogger) Error(args ...interface{})

func (CommonLogger) Fatal

func (l CommonLogger) Fatal(args ...interface{})

func (CommonLogger) Info

func (l CommonLogger) Info(args ...interface{})

func (CommonLogger) Panic

func (l CommonLogger) Panic(args ...interface{})

func (CommonLogger) Warn

func (l CommonLogger) Warn(args ...interface{})

type EmqxLogger added in v1.2.40

type EmqxLogger struct {
	*Logger
}

func NewEmqxLogger added in v1.2.40

func NewEmqxLogger(logger *Logger) EmqxLogger

NewEmqxLogger 创建一个emqx日志对象

func (EmqxLogger) DPanic added in v1.2.40

func (l EmqxLogger) DPanic(args ...interface{})

func (EmqxLogger) Debug added in v1.2.40

func (l EmqxLogger) Debug(args ...interface{})

func (EmqxLogger) Error added in v1.2.40

func (l EmqxLogger) Error(args ...interface{})

func (EmqxLogger) Fatal added in v1.2.40

func (l EmqxLogger) Fatal(args ...interface{})

func (EmqxLogger) Info added in v1.2.40

func (l EmqxLogger) Info(args ...interface{})

func (EmqxLogger) Panic added in v1.2.40

func (l EmqxLogger) Panic(args ...interface{})

func (EmqxLogger) Printf added in v1.2.40

func (l EmqxLogger) Printf(format string, args ...interface{})

func (EmqxLogger) Println added in v1.2.40

func (l EmqxLogger) Println(args ...interface{})

func (EmqxLogger) Warn added in v1.2.40

func (l EmqxLogger) Warn(args ...interface{})

type GormLogger

type GormLogger struct {
	glogger.Interface
	glogger.Config

	*Logger
	// contains filtered or unexported fields
}

func NewGormLogger

func NewGormLogger(config glogger.Config) *GormLogger

NewGormLogger returns a new GormLogger instance.

func (*GormLogger) Error

func (l *GormLogger) Error(ctx context.Context, msg string, data ...interface{})

Error print error messages

func (*GormLogger) Info

func (l *GormLogger) Info(ctx context.Context, msg string, data ...interface{})

Info print info

func (*GormLogger) LogMode

func (l *GormLogger) LogMode(level glogger.LogLevel) glogger.Interface

LogMode log mode

func (*GormLogger) Trace

func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

Trace print sql message

func (*GormLogger) Warn

func (l *GormLogger) Warn(ctx context.Context, msg string, data ...interface{})

Warn print warn messages

type KratosLogger

type KratosLogger struct {
	*Logger
}

func (KratosLogger) Log

func (l KratosLogger) Log(level klog.Level, msg ...interface{}) error

type Level

type Level zapcore.Level

type Logger

type Logger struct {
	*zap.Logger
}

func GetLogger

func GetLogger() *Logger

func (*Logger) DPanic

func (l *Logger) DPanic(deep int, args ...interface{})

func (*Logger) Debug

func (l *Logger) Debug(deep int, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(deep int, args ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(deep int, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(deep int, args ...interface{})

func (*Logger) Panic

func (l *Logger) Panic(deep int, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(deep int, args ...interface{})

type NacosLogger

type NacosLogger struct {
	Logger
}

func NewNacosLogger

func NewNacosLogger(logger *Logger) NacosLogger

NewNacosLogger 创建一个nacos日志对象

func (NacosLogger) Debug

func (l NacosLogger) Debug(args ...interface{})

func (NacosLogger) Debugf

func (l NacosLogger) Debugf(format string, args ...interface{})

func (NacosLogger) Error

func (l NacosLogger) Error(args ...interface{})

func (NacosLogger) Errorf

func (l NacosLogger) Errorf(format string, args ...interface{})

func (NacosLogger) Info

func (l NacosLogger) Info(args ...interface{})

func (NacosLogger) Infof

func (l NacosLogger) Infof(format string, args ...interface{})

func (NacosLogger) Warn

func (l NacosLogger) Warn(args ...interface{})

func (NacosLogger) Warnf

func (l NacosLogger) Warnf(format string, args ...interface{})

Directories

Path Synopsis
gin module
gorm module
kratos module
lgin module
lgorm module
lkratos module

Jump to

Keyboard shortcuts

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