gormrus

package module
v0.0.0-...-29982f3 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2016 License: MIT Imports: 6 Imported by: 1

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.FieldLogger) *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.FieldLogger) *gormLogger

NewWithNameAndLogger Create new logger with custom name and logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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