Documentation ¶
Index ¶
- Constants
- func DPanic(args ...interface{})
- func Debug(args ...interface{})
- func Error(args ...interface{})
- func Fatal(args ...interface{})
- func Format(value ...interface{}) string
- func GetWriter() io.Writer
- func GinLogger() gin.HandlerFunc
- func GinRecovery(stack bool) gin.HandlerFunc
- func Info(args ...interface{})
- func InitLogger(filename string, level zapcore.Level)
- func InitLoggerWithOutFile(level zapcore.Level)
- func KratosServer(logger klog.Logger) middleware.Middleware
- func NewKratosLogger(logger *Logger) klog.Logger
- func Panic(args ...interface{})
- func Recovery()
- func Warn(args ...interface{})
- func WithCollector(service int32, collector Collector)
- type Collector
- type CommonLogger
- func (l CommonLogger) DPanic(args ...interface{})
- func (l CommonLogger) Debug(args ...interface{})
- func (l CommonLogger) Error(args ...interface{})
- func (l CommonLogger) Fatal(args ...interface{})
- func (l CommonLogger) Info(args ...interface{})
- func (l CommonLogger) Panic(args ...interface{})
- func (l CommonLogger) Warn(args ...interface{})
- type Details
- type EmqxLogger
- func (l EmqxLogger) DPanic(args ...interface{})
- func (l EmqxLogger) Debug(args ...interface{})
- func (l EmqxLogger) Error(args ...interface{})
- func (l EmqxLogger) Fatal(args ...interface{})
- func (l EmqxLogger) Info(args ...interface{})
- func (l EmqxLogger) Panic(args ...interface{})
- func (l EmqxLogger) Printf(format string, args ...interface{})
- func (l EmqxLogger) Println(args ...interface{})
- func (l EmqxLogger) Warn(args ...interface{})
- type GormLogger
- func (l *GormLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (l *GormLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (l *GormLogger) LogMode(level glogger.LogLevel) glogger.Interface
- func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l *GormLogger) Warn(ctx context.Context, msg string, data ...interface{})
- type KratosLogger
- type Level
- type Logger
- func (l *Logger) DPanic(deep int, args ...interface{})
- func (l *Logger) Debug(deep int, args ...interface{})
- func (l *Logger) Error(deep int, args ...interface{})
- func (l *Logger) Fatal(deep int, args ...interface{})
- func (l *Logger) Info(deep int, args ...interface{})
- func (l *Logger) Panic(deep int, args ...interface{})
- func (l *Logger) Warn(deep int, args ...interface{})
- func (l *Logger) WithCollector(service int32, collector Collector)
- type NacosLogger
- func (l NacosLogger) Debug(args ...interface{})
- func (l NacosLogger) Debugf(format string, args ...interface{})
- func (l NacosLogger) Error(args ...interface{})
- func (l NacosLogger) Errorf(format string, args ...interface{})
- func (l NacosLogger) Info(args ...interface{})
- func (l NacosLogger) Infof(format string, args ...interface{})
- func (l NacosLogger) Warn(args ...interface{})
- func (l NacosLogger) Warnf(format string, args ...interface{})
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 GinRecovery ¶
func GinRecovery(stack bool) gin.HandlerFunc
GinRecovery recover掉项目可能出现的panic,并使用zap记录相关日志
func InitLogger ¶
InitLogger level: debug,info,warn,error,panic,fatal
func InitLoggerWithOutFile ¶
func KratosServer ¶
func KratosServer(logger klog.Logger) middleware.Middleware
KratosServer is an server logging middleware.
func NewKratosLogger ¶
NewKratosLogger returns a new kratos logger
func WithCollector ¶ added in v1.6.1
WithCollector 添加收集器
Types ¶
type CommonLogger ¶
type CommonLogger struct {
Logger
}
CommonLogger fmgo内部通用日志接口
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 Details ¶ added in v1.6.1
type Details struct { // 日志等级:1:debug;2:info;3:warn;4:error;5:panic;6:dpanic;7:fatal;8:dfatal Level int32 `json:"level,omitempty"` // 调用log的文件路径 Path string `json:"path,omitempty"` // 服务序号,需要自行规范,用于区分不同服务的日志 Service int32 `json:"service,omitempty"` // Time holds the value of the "time" field. Time time.Time `json:"time,omitempty"` // 日志内容 Message string `json:"message,omitempty"` }
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
type KratosLogger ¶
type KratosLogger struct {
*Logger
}
type Logger ¶
func (*Logger) WithCollector ¶ added in v1.6.1
WithCollector 添加收集器
type NacosLogger ¶
type NacosLogger struct {
Logger
}
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{})
Source Files ¶
Click to show internal directories.
Click to hide internal directories.