logger

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const MsecLocalTimeFormat = "2006-01-02 15:04:05.000"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ZapConfig zap.Config
	LogRotate lumberjack.Logger
}

type Logger

type Logger interface {
	GetZapLogger() *zap.SugaredLogger
	LogMode(level gormLogger.LogLevel) gormLogger.Interface
	Info(ctx context.Context, msg string, data ...interface{})
	Warn(ctx context.Context, msg string, data ...interface{})
	Error(ctx context.Context, msg string, data ...interface{})
	Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
}

Logger is an zap logger, it's an alternative implementation of *gorm.Logger

func InitLogger

func InitLogger(cfg *config.Configuration) (Logger, error)

func NewLogger

func NewLogger(sugar *zap.SugaredLogger) Logger

NewLogger is constructor for logger

Jump to

Keyboard shortcuts

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