Documentation ¶
Index ¶
- Variables
- func GetLogWriter(name string) io.Writer
- func GetLoggerByName(name string) logr.Logger
- func Logger() logr.Logger
- func ParseTime(timestamp int64) string
- func Term() string
- type GormLogger
- func (l *GormLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (l *GormLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface
- func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (l *GormLogger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Yellow = color.New(color.FgHiYellow, color.Bold).SprintFunc() YellowItalic = color.New(color.FgHiYellow, color.Bold, color.Italic).SprintFunc() Green = color.New(color.FgHiGreen, color.Bold).SprintFunc() Blue = color.New(color.FgHiBlue, color.Bold).SprintFunc() Cyan = color.New(color.FgCyan, color.Bold, color.Underline).SprintFunc() Red = color.New(color.FgHiRed, color.Bold).SprintFunc() White = color.New(color.FgWhite).SprintFunc() WhiteBold = color.New(color.FgWhite, color.Bold).SprintFunc() )
Functions ¶
func GetLogWriter ¶
func GetLoggerByName ¶
GetLoggerByName returns a log that writes to std or both std and disk files if onDisk option is set to true. Log files are exactly named after given log name.
Types ¶
type GormLogger ¶
GormLogger 自定义的GORM 日志对象
func (*GormLogger) Error ¶
func (l *GormLogger) Error(ctx context.Context, msg string, data ...interface{})
Error logs the error level messages.
func (*GormLogger) Info ¶
func (l *GormLogger) Info(ctx context.Context, msg string, data ...interface{})
Info logs the information level messages.
func (*GormLogger) LogMode ¶
func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface
LogMode sets the logging level.
Click to show internal directories.
Click to hide internal directories.