log

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2020 License: Apache-2.0, BSD-3-Clause, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = (os.Getenv("DEBUG") == "1")

Debug true if environment variable DEBUG is set to 1

Functions

func Exit

func Exit(status int)

Exit calls exiter.Exit with status

func Fatal

func Fatal(v ...interface{})

Fatal prints value and exits with status 1

func Fatalf

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

Fatalf prints formatted value and exits with status 1

func Fatalln

func Fatalln(v ...interface{})

Fatalln prints value line and exits with status 1

func Print

func Print(v ...interface{})

Print prints value

func Printf

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

Printf prints formatted value

func Println

func Println(v ...interface{})

Println print value line

func SetExiter

func SetExiter(e Exiter)

SetExiter sets exiter

func Trace

func Trace(v ...interface{})

Trace print value if Debug flag is on

func Tracef

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

Tracef print formatted value if Debug flag is on

func Traceln

func Traceln(v ...interface{})

Traceln print value line if Debug flag is on

Types

type DefaultExiter

type DefaultExiter struct {
}

DefaultExiter default exiter structure

func (DefaultExiter) Exit

func (e DefaultExiter) Exit(status int)

Exit exit program with status

type Exiter

type Exiter interface {
	Exit(status int)
}

Exiter exiter interface

func GetExiter

func GetExiter() Exiter

GetExiter returns exiter

Jump to

Keyboard shortcuts

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