logger

package
v0.0.0-...-2637cd7 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Based on https://github.com/wei840222/gorm-zerolog/blob/main/logger.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(module string) *zerolog.Event

func Error

func Error(module string) *zerolog.Event

func Fatal

func Fatal(module string) *zerolog.Event

func Gin

func Gin() gin.HandlerFunc

func Info

func Info(module string) *zerolog.Event

func MultiOutput

func MultiOutput(app, logDir string)

func Panic

func Panic(module string) *zerolog.Event

func Trace

func Trace(module string) *zerolog.Event

func Warn

func Warn(module string) *zerolog.Event

Types

type GormLogger

type GormLogger struct {
	SlowThreshold         time.Duration
	SourceField           string
	SkipErrRecordNotFound bool
	Logger                zerolog.Logger
}

func Gorm

func Gorm() *GormLogger

func (*GormLogger) Error

func (logger *GormLogger) Error(ctx context.Context, s string, args ...interface{})

func (*GormLogger) Info

func (logger *GormLogger) Info(ctx context.Context, s string, args ...interface{})

func (*GormLogger) LogMode

func (*GormLogger) Trace

func (logger *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)

func (*GormLogger) Warn

func (logger *GormLogger) Warn(ctx context.Context, s string, args ...interface{})

Jump to

Keyboard shortcuts

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