Documentation ¶
Index ¶
- Constants
- func NewLogger(logger *zap.Logger, conf *config.OrmLogConfig, optHooks ...Hook) logger.Interface
- func NewLoggerInterface(writer Writer, config logger.Config) logger.Interface
- func ParserLevel(lev string) (level logger.LogLevel)
- func Register(driver string, dialect DialectFunc) (err error)
- type ConfigOption
- type DBHelper
- type DialectFunc
- type Entry
- type Hook
- type Hooks
- type Writer
Constants ¶
View Source
const ( Reset = logger.Reset Red = logger.Red Green = logger.Green Yellow = logger.Yellow Blue = logger.Blue Magenta = logger.Magenta Cyan = logger.Cyan White = logger.White BlueBold = logger.BlueBold MagentaBold = logger.MagentaBold RedBold = logger.RedBold YellowBold = logger.YellowBold )
Colors
Variables ¶
This section is empty.
Functions ¶
func NewLoggerInterface ¶
func ParserLevel ¶
ParserLevel 从字符串中解析 gorm 的日志等级 默认值为 info
func Register ¶
func Register(driver string, dialect DialectFunc) (err error)
Types ¶
type ConfigOption ¶
func WithLogger ¶
func WithLogger(l logger.Interface) ConfigOption
func WithLoggerV2 ¶
func WithLoggerV2(logger *zap.Logger, conf *config.OrmLogConfig, optHooks ...Hook) ConfigOption
func WithName ¶
func WithName(strategy schema.Namer) ConfigOption
func WithSingularTable ¶
func WithSingularTable() ConfigOption
type DBHelper ¶
func NewDBHelper ¶
func NewDBHelper(conf *config.EngineConfig, opts ...ConfigOption) (helper DBHelper, err error)
type DialectFunc ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.