Documentation ¶
Index ¶
- type BannedKeyword
- type LoggerGorm
- func (lm *LoggerGorm) Error(ctx context.Context, msg string, args ...interface{})
- func (lm *LoggerGorm) Info(ctx context.Context, msg string, args ...interface{})
- func (lm *LoggerGorm) LogMode(level logger.LogLevel) logger.Interface
- func (lm *LoggerGorm) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (lm *LoggerGorm) Warn(ctx context.Context, msg string, args ...interface{})
- type OptGorm
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BannedKeyword ¶
type LoggerGorm ¶
func New ¶
func New(opt *OptGorm) (*LoggerGorm, error)
func (*LoggerGorm) Error ¶
func (lm *LoggerGorm) Error(ctx context.Context, msg string, args ...interface{})
func (*LoggerGorm) Info ¶
func (lm *LoggerGorm) Info(ctx context.Context, msg string, args ...interface{})
func (*LoggerGorm) LogMode ¶
func (lm *LoggerGorm) LogMode(level logger.LogLevel) logger.Interface
LogMode implementation log mode.
type OptGorm ¶
type OptGorm struct { //ignore if not found error happened SkipErrRecordNotFound bool //slow sql threshold SlowThreshold time.Duration //record line number and filename IsHelper bool //replace sensitive word, such as password BKeywords []BannedKeyword // if set to true, it will add latency information for your queries LogLatency bool //gorm log level for automatically triggering //logrus log level is debug and don't need to modify LogLevel logger.LogLevel //logrus parameters OptLogrus *c.OptLog }
Click to show internal directories.
Click to hide internal directories.