log

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: Unlicense Imports: 9 Imported by: 117

Documentation

Index

Constants

View Source
const (
	ERROR = iota
	INFO  = iota
	DEBUG = iota
)

Logging level

Variables

This section is empty.

Functions

func Debug

func Debug(format string, args ...interface{})

Debug writes to debug log

func Error

func Error(format string, args ...interface{})

Error writes to error log

func Fatal

func Fatal(args ...interface{})

Fatal writes to error log and exits application

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf writes to error log and exits application

func GetLevel added in v0.1.3

func GetLevel() int

GetLevel returns logLevel

func Info

func Info(format string, args ...interface{})

Info writes to info log

func Print

func Print(args ...interface{})

Print writes to info log

func Printf

func Printf(format string, args ...interface{})

Printf writes to info log

func Println

func Println(args ...interface{})

Println writes to info log

func SetLevel

func SetLevel(level int)

SetLevel sets logging level

func SetOutput

func SetOutput(w io.Writer)

SetOutput sets output printing method

func Tracef

func Tracef(format string, args ...interface{})

Tracef writes to debug log and adds the calling function's name

Types

type Timer added in v0.1.2

type Timer struct {
	// contains filtered or unexported fields
}

Timer is a wrapper for time

func StartTimer added in v0.1.2

func StartTimer() Timer

StartTimer returns a Timer with a start time

func (*Timer) LogElapsed added in v0.1.2

func (t *Timer) LogElapsed(message string, args ...interface{})

LogElapsed writes to log message and elapsed time

Jump to

Keyboard shortcuts

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