logger

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfoLevel = iota
	ErrorLevel
	Disabled
)

Variables

View Source
var (
	Error  = errorLog.Println
	Errorf = errorLog.Printf
	Info   = infoLog.Println
	Infof  = infoLog.Printf
)

Functions

func ExplainSQL

func ExplainSQL(m *QueryStatus, show bool)

func SetLevel

func SetLevel(level int)

如果设置为 ErrorLevel,infoLog 的输出会被定向到 ioutil.Discard,即不打印该日志

Types

type QueryStatus

type QueryStatus struct {
	Query string
	Args  interface{}

	Start time.Time
	End   time.Time

	Err error
}

func (*QueryStatus) String

func (q *QueryStatus) String() string

Jump to

Keyboard shortcuts

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