gormlog

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 4 Imported by: 0

README

gormlog

Go Reference

Zerolog logging for gorm

Installation

go get -u github.com/petoem/gormlog

Usage

import (
	"gorm.io/gorm"
    "gorm.io/driver/sqlite"
    "github.com/rs/zerolog/log"

    "github.com/petoem/gormlog"
)

logger := gormlog.NewLogger(log.Logger)
db, err = gorm.Open(sqlite.Open("db.sqlite"), &gorm.Config{Logger: logger})

Contributing

If you wish to contribute to the code or documentation, feel free to fork the repository and submit a pull request.

License

Licensed under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(log zerolog.Logger) gorm.Interface

Types

This section is empty.

Jump to

Keyboard shortcuts

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