log

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Debug true if environment variable DEBUG is set to 1, 2 or 3

View Source
var DebugResponse = os.Getenv("DEBUG") == "3"

DebugResponse true if environment variable DEBUG is set to 3

View Source
var DebugSensitive = (os.Getenv("DEBUG") == "2" || os.Getenv("DEBUG") == "3")

DebugSensitive true if environment variable DEBUG is set to 2 or 3

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

type Response added in v1.4.9

type Response struct {
	Head *http.Response
	Body []byte
}

func (Response) String added in v1.4.9

func (r Response) String() (message string)

type Sensitive added in v1.4.4

type Sensitive struct {
	Data interface{}
}

Sensitive is a wrapper around any sensitive data that should not be logged, except the corresponding flag is set to true

func (Sensitive) String added in v1.4.4

func (s Sensitive) String() string

Jump to

Keyboard shortcuts

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