log

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FATAL = 100
	ERROR = 40
	INFO  = 20
	DEBUG = 10
	TRACE = 5
)

Level values

Variables

View Source
var Level = ERROR

Level is the log level.

View Source
var LogQuery = false

LogQuery enables query logging regardless of level.

View Source
var STRINGLEVEL = map[int]string{
	FATAL: "FATAL",
	ERROR: "ERROR",
	INFO:  "INFO",
	DEBUG: "DEBUG",
	TRACE: "TRACE",
}

STRINGLEVEL is the reverse mapping

Functions

func Debug

func Debug(fmts string, a ...interface{})

Debug for debugging messages.

func Error

func Error(fmts string, a ...interface{})

Error for notable errors.

func Exit

func Exit(fmts string, args ...interface{})

Exit with an error message.

func Fatal

func Fatal(fmts string, a ...interface{})

Fatal for fatal, unrecoverable errors.

func Info

func Info(fmts string, a ...interface{})

Info for regular messages.

func Print

func Print(fmts string, args ...interface{})

Print - simple print, without timestamp, without regard to log level.

func QueryStart added in v0.7.2

func QueryStart(qstr string, a ...interface{})

QueryStart logs database query beginnings; requires TRACE.

func QueryTime added in v0.7.2

func QueryTime(t time.Time, qstr string, a ...interface{})

QueryTime logs database queries and time relative to start; requires LogQuery or TRACE.

func SetLevel

func SetLevel(lvalue int)

SetLevel sets the log level.

func SetLevelByName added in v0.7.2

func SetLevelByName(lstr string)

SetLevelByName sets the log level by string name.

func SetQueryLog added in v0.7.2

func SetQueryLog(v bool)

SetQueryLog enables or disables query logging.

Types

This section is empty.

Jump to

Keyboard shortcuts

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