gorm_logrus

package module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: MIT Imports: 7 Imported by: 0

README

gorm-logrus

Logrus logger for gorm v2

package main

import (
  "gorm.io/gorm"
  "gorm.io/driver/sqlite"
  "github.com/onrik/gorm-logrus"
)

func main() {
  db, err := gorm.Open(sqlite.Open("test.db"), &gorm.Config{
    Logger: gorm_logrus.New(),
  })
  if err != nil {
    panic("failed to connect database")
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *logger

func NewWithLogger

func NewWithLogger(l logrus.FieldLogger) *logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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