ullimpl

package
v0.9.5-rc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

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

View Source
const (
	// Silent silent log level
	Silent = logger.Silent
	// Info info log level
	Info = logger.Info
	// Warn warn log level
	Warn = logger.Warn
	// Error error log level
	Error = logger.Error
)

Variables

This section is empty.

Functions

func NewDBHelper

func NewDBHelper(conf *config.EngineConfig, opts ...ConfigOption) (helper ugorm.DBHelper, err error)

func NewLogger

func NewLogger(log *zap.Logger, conf *config.OrmLogConfig, optHooks ...ugorm.Hook) logger.Interface

func NewLoggerInterface

func NewLoggerInterface(writer Writer, config logger.Config) logger.Interface

func ParserLevel

func ParserLevel(lev string) (level logger.LogLevel)

ParserLevel 从字符串中解析 gorm 的日志等级 默认值为 info

Types

type ConfigOption

type ConfigOption func(c *gorm.Config)

func WithLogger

func WithLogger(l logger.Interface) ConfigOption

func WithName

func WithName(strategy schema.Namer) ConfigOption

func WithSingularTable

func WithSingularTable() ConfigOption

type Writer

type Writer interface {
	Printf(ctx context.Context, level logger.LogLevel, format string, values ...interface{})
}

func NewWriter

func NewWriter(logger *zap.Logger, optHooks ...ugorm.Hook) (w Writer)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL