plog

package
v0.4.65 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: ISC Imports: 13 Imported by: 1

Documentation

Overview

plog provides log instances with Log Logw Info Debug D SetDebug SetRegexp SetRegexp SetSilent IsThisDebug IsSilent. Static delegasting functions are available in parl, like parl.Log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoPrint added in v0.4.25

func NoPrint(format string, a ...interface{})

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) GetD added in v0.4.26

func (lg *LogInstance) GetD(skipFrames int) (debug func(format string, a ...interface{}))

func (*LogInstance) GetDebug added in v0.4.25

func (lg *LogInstance) GetDebug(skipFrames int) (debug func(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() (isDebug bool)

IsThisDebug returns whether debug logging is configured

func (*LogInstance) IsThisDebugN added in v0.4.25

func (lg *LogInstance) IsThisDebugN(skipFrames int) (isDebug bool)

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) Logw added in v0.4.12

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

Logw invocations always print. Logw outputs withoput appending newline

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