Documentation ¶
Index ¶
- Constants
- Variables
- func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
- func Debug(msg string, field ...zap.Field)
- func Error(msg string, field ...zap.Field)
- func Fatal(msg string, field ...zap.Field)
- func GetGormLoggerConfig() logger.Config
- func GetGormZapWriter(config logger.Config) (logger.Interface, error)
- func Info(msg string, field ...zap.Field)
- func InitLogger(config Config, serverType consts.ServerType, serviceId string, ...)
- func Sugar() *zap.SugaredLogger
- func Warn(msg string, field ...zap.Field)
- type Config
- type EncoderOptions
- type GormZapWriter
- func (w *GormZapWriter) Error(ctx context.Context, msg string, data ...interface{})
- func (w *GormZapWriter) Info(ctx context.Context, msg string, data ...interface{})
- func (w *GormZapWriter) LogMode(level logger.LogLevel) logger.Interface
- func (w *GormZapWriter) Trace(ctx context.Context, begin time.Time, ...)
- func (w *GormZapWriter) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
View Source
const ( JsonEncoder = "json" ConsoleEncoder = "console" LowercaseLevelEncoder = "LowercaseLevelEncoder" LowercaseColorLevelEncoder = "LowercaseColorLevelEncoder" CapitalLevelEncoder = "CapitalLevelEncoder" CapitalColorLevelEncoder = "CapitalColorLevelEncoder" ShortCallerEncoder = "ShortCallerEncoder" FullCallerEncoder = "FullCallerEncoder" )
Variables ¶
View Source
var Logger *zap.Logger
Functions ¶
func CustomTimeEncoder ¶
func CustomTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)
CustomTimeEncoder time format
func GetGormLoggerConfig ¶
func InitLogger ¶
func InitLogger(config Config, serverType consts.ServerType, serviceId string, serverMode consts.ServerMode)
func Sugar ¶
func Sugar() *zap.SugaredLogger
Types ¶
type EncoderOptions ¶
type GormZapWriter ¶
func (*GormZapWriter) Error ¶
func (w *GormZapWriter) Error(ctx context.Context, msg string, data ...interface{})
func (*GormZapWriter) Info ¶
func (w *GormZapWriter) Info(ctx context.Context, msg string, data ...interface{})
func (*GormZapWriter) LogMode ¶
func (w *GormZapWriter) LogMode(level logger.LogLevel) logger.Interface
Click to show internal directories.
Click to hide internal directories.