gormzap

package module
v0.0.0-...-a558a24 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 4 Imported by: 0

README

gormzap

Gorm adapter for zap logger

Usage

import "github.com/only1nft/gormzap"

db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{Logger: gormzap.New(logger)})

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormZap

type GormZap struct {
	L *zap.SugaredLogger
	logger.Interface
}

func New

func New(l *zap.Logger) GormZap

func (GormZap) Error

func (gz GormZap) Error(_ context.Context, msg string, args ...interface{})

func (GormZap) Info

func (gz GormZap) Info(_ context.Context, msg string, args ...interface{})

func (GormZap) Trace

func (gz GormZap) Trace(_ context.Context, _ time.Time, fc func() (sql string, rowsAffected int64), err error)

func (GormZap) Warn

func (gz GormZap) Warn(_ context.Context, msg string, args ...interface{})

Jump to

Keyboard shortcuts

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