logger

package
v1.0.19-pre Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Logger      = GeneosLogger{os.Stdout, INFO, false}
	DebugLogger = GeneosLogger{os.Stderr, DEBUG, true}
	ErrorLogger = GeneosLogger{os.Stderr, ERROR, true}

	Log   = log.New(Logger, "", 0)
	Debug = log.New(DebugLogger, "", 0)
	Error = log.New(ErrorLogger, "", 0)
)

debuglog must be defined so it can be set in EnableDebugLog() so for consistency do the same for all three loggers

Functions

func DisableDebugLog

func DisableDebugLog()

func EnableDebugLog

func EnableDebugLog()

Types

type GeneosLogger

type GeneosLogger struct {
	Writer     io.Writer
	Level      Level
	ShowPrefix bool
}

func (*GeneosLogger) DisablePrefix added in v1.2.1

func (g *GeneosLogger) DisablePrefix()

func (*GeneosLogger) EnablePrefix added in v1.2.1

func (g *GeneosLogger) EnablePrefix()

func (GeneosLogger) Write

func (g GeneosLogger) Write(p []byte) (n int, err error)

type Level

type Level int
const (
	INFO Level = iota
	DEBUG
	WARNING
	ERROR
	FATAL
)

func (Level) String

func (level Level) String() string

Jump to

Keyboard shortcuts

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