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 KratosServer(logger klog.Logger) middleware.Middleware
- func NewKratosLogger(logger *Logger) klog.Logger
- func Panic(args ...interface{})
- func Recovery()
- func 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
- 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 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 KratosServer ¶
func KratosServer(logger klog.Logger) middleware.Middleware
KratosServer is an server logging middleware.
func NewKratosLogger ¶
NewKratosLogger returns a new kratos logger
Types ¶
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 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{})
Click to show internal directories.
Click to hide internal directories.