plog

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2022 License: ISC Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLog

func GetLog(writer io.Writer) *log.Logger

Types

type LogInstance

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

LogInstance provide logging delegating to log.Output

func NewLog

func NewLog(writers ...io.Writer) (lg *LogInstance)

NewLog gets a logger for Fatal and Warning for specific output

func NewLogFrames

func NewLogFrames(writer io.Writer, extraStackFramesToSkip int) (lg *LogInstance)

NewLog gets a logger for Fatal and Warning for specific output

func (*LogInstance) D

func (lg *LogInstance) D(format string, a ...interface{})

D prints to stderr with code location Thread safe. D is meant for temporary output intended to be removed before check-in

func (*LogInstance) Debug

func (lg *LogInstance) Debug(format string, a ...interface{})

Debug outputs only if debug is configured or the code location package matches regexp

func (*LogInstance) Info

func (lg *LogInstance) Info(format string, a ...interface{})

Info prints unless silence has been configured with SetSilence(true) IsSilent deteremines the state of silence if debug is enabled, code location is appended

func (*LogInstance) IsSilent

func (lg *LogInstance) IsSilent() (isSilent bool)

IsSilent if true it means that Info does not print

func (*LogInstance) IsThisDebug

func (lg *LogInstance) IsThisDebug() bool

IsThisDebug returns whether debug logging is configured

func (*LogInstance) Log

func (lg *LogInstance) Log(format string, a ...interface{})

Log invocations always print if debug is enabled, code location is appended

func (*LogInstance) SetDebug

func (lg *LogInstance) SetDebug(debug bool)

SetDebug prints everything with code location: IsInfo

func (*LogInstance) SetRegexp

func (lg *LogInstance) SetRegexp(regExp string) (err error)

func (*LogInstance) SetSilent

func (lg *LogInstance) SetSilent(silent bool)

SetSilent only prints Log

Jump to

Keyboard shortcuts

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