Documentation ¶
Index ¶
- func NewEchoZerlogLogger(logger *zerolog.Logger) echo.MiddlewareFunc
- func NewEchoZerlogLoggerWithConfig(logger *zerolog.Logger, config middleware.RequestLoggerConfig) echo.MiddlewareFunc
- func NewZerlogRequestLogger(logger *zerolog.Logger) func(ctx echo.Context, values middleware.RequestLoggerValues) error
- type GormLogger
- func (gl *GormLogger) Error(_ context.Context, message string, data ...interface{})
- func (gl *GormLogger) Info(_ context.Context, message string, data ...interface{})
- func (gl *GormLogger) LogMode(logger.LogLevel) logger.Interface
- func (gl *GormLogger) Trace(_ context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), ...)
- func (gl *GormLogger) Warn(_ context.Context, message string, data ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewEchoZerlogLogger ¶
NewEchoZerlogLogger builds a logging middleware with default config.
func NewEchoZerlogLoggerWithConfig ¶
func NewEchoZerlogLoggerWithConfig(logger *zerolog.Logger, config middleware.RequestLoggerConfig) echo.MiddlewareFunc
NewEchoZerlogLoggerWithConfig builds a logging middleware with custom config.
func NewZerlogRequestLogger ¶
func NewZerlogRequestLogger( logger *zerolog.Logger, ) func(ctx echo.Context, values middleware.RequestLoggerValues) error
NewZerlogRequestLogger generates the logger function being used by the logging middleware.
Types ¶
type GormLogger ¶
type GormLogger struct {
// contains filtered or unexported fields
}
GormLogger handles logging of gorm logs.
func NewGormLogger ¶
func NewGormLogger(logger *zerolog.Logger) *GormLogger
NewGormLogger creates a new GormLogger.
func (*GormLogger) Error ¶
func (gl *GormLogger) Error(_ context.Context, message string, data ...interface{})
Error logs on error level.
func (*GormLogger) Info ¶
func (gl *GormLogger) Info(_ context.Context, message string, data ...interface{})
Info logs on info level.
func (*GormLogger) LogMode ¶
func (gl *GormLogger) LogMode(logger.LogLevel) logger.Interface
LogMode should change the loggers log level. zerlog does not need this change on the fly. The function just exists to satisfy the logger.Interface.
Click to show internal directories.
Click to hide internal directories.