log

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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

Level values

Variables

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

LEVELSTRINGS provides log level aliases.

View Source
var Level = ERROR

Level is the log level.

View Source
var LogQuery = false

LogQuery is a flag for logging database queries.

View Source
var STRINGLEVEL = map[int]string{}

STRINGLEVEL is the reverse mapping

Functions

func Debug

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

Debug for debugging messages.

func Error

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

Error for notable errors.

func Exit

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

Exit with an error message.

func Fatal

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

Fatal for fatal, unrecoverable errors.

func Info

func Info(fmt 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 Query

func Query(fmt string, a ...interface{})

Query for printing database queries and statistics.

func SetLevel

func SetLevel(lvalue int)

SetLevel sets the log level.

Types

This section is empty.

Jump to

Keyboard shortcuts

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