gormrus

package module
Version: v0.0.0-...-f0a3152 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2019 License: MIT Imports: 6 Imported by: 0

README

Gormrus

GoDoc

Overview

Gormrus is a library for integrating Logrus logger with Gorm

Usage

    package main
    import (
        "github.com/jinzhu/gorm"
        _ "github.com/go-sql-driver/mysql"
        "github.com/o1egl/gormrus"
    )

    db, err = gorm.Open("mysql", "user:password@/dbname?charset=utf8&parseTime=True&loc=Local")
    db.LogMode(true)
    db.SetLogger(gormrus.New())

Gormrus is released under the MIT license. See LICENSE

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *gormLogger

New Create new logger

func NewWithLogger

func NewWithLogger(logger *logrus.Logger) *gormLogger

NewWithLogger Create new logger with custom logger

func NewWithName

func NewWithName(name string) *gormLogger

NewWithName Create new logger with custom name

func NewWithNameAndLogger

func NewWithNameAndLogger(name string, logger *logrus.Logger) *gormLogger

NewWithNameAndLogger Create new logger with custom name and logger

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL