log

package module
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: BSD-3-Clause Imports: 7 Imported by: 49

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool, a ...any)

func Error

func Error(err error, a ...any)

func Exit

func Exit(a ...any)

exit() # yep. exits. I guess everything must be fine exit(3) # I guess 3 it is then exit("dont like apples") # ok. I'll make a note of that

func Fatal

func Fatal(s string, a ...any)

func Fatalf

func Fatalf(s string, a ...any)

func Fatalln added in v0.5.5

func Fatalln(a ...any)

func Info

func Info(a ...any)

func Infof

func Infof(s string, a ...any)

func Log

func Log(f *LogFlag, a ...any)

func Logf

func Logf(f *LogFlag, s string, a ...any)

func Printf

func Printf(s string, a ...any)

func Println

func Println(a ...any)

func ProcessFlags

func ProcessFlags(callback func(*LogFlag))

TODO, switch to this. maybe.

func SetAll

func SetAll(b bool)

set all the flags

func SetDefaults

func SetDefaults()

set all the flags

func SetTmpOLD added in v0.20.4

func SetTmpOLD()

start writing all the logging to a tmp file

func Sleep

func Sleep(a ...any)

sleep() # you know what this does? sleeps for 1 second. yep. dump. easy. sleep(.1) # you know what this does? yes, it sleeps for 1/10th of a second

func Spew

func Spew(b any, a ...any)

func UnsetTmp added in v0.17.0

func UnsetTmp()

start writing all the logging to a tmp file

func Verbose

func Verbose(a ...any)

func Warn

func Warn(a ...any)

Types

type LogFlag

type LogFlag struct {
	// contains filtered or unexported fields
}
var ERROR *LogFlag // toggles log.Warn() (true by default)
var INFO *LogFlag // toggles log.Info()
var PRINTLN *LogFlag // toggles log.Println() (true by default)
var SPEW *LogFlag // toggles log.Spew()
var VERBOSE *LogFlag // toggles log.Verbose()
var WARN *LogFlag // toggles log.Warn() (true by default)

func NewFlag

func NewFlag(name string, b bool, full, short, desc string) *LogFlag

this is what the current log.SetFlag() function should become

func ShowFlags

func ShowFlags() []*LogFlag

this bypasses all checks and _always_ logs the info to STDOUT is this a bad idea? Probably not.... TODO: returning []*LogFlag is not safe and access must be locked but this is only used by the log debugging window at this time

func (*LogFlag) Bool added in v0.5.6

func (f *LogFlag) Bool() bool

probably a better name than Get() switch to this

func (*LogFlag) Get

func (f *LogFlag) Get() bool

returns the value of the flag

func (*LogFlag) GetDefault added in v0.5.6

func (f *LogFlag) GetDefault() bool

returns the description of the flag

func (*LogFlag) GetDesc

func (f *LogFlag) GetDesc() string

returns the description of the flag

func (*LogFlag) GetName

func (f *LogFlag) GetName() string

returns the name of the flag

func (*LogFlag) GetSubsystem

func (f *LogFlag) GetSubsystem() string

returns the subsystem of the flag

func (*LogFlag) Ok

func (f *LogFlag) Ok() bool

simply protects against panic() by making sure it exists.

func (*LogFlag) SetBool added in v0.5.6

func (f *LogFlag) SetBool(b bool)

func (*LogFlag) SetDefault

func (f *LogFlag) SetDefault()

restores flag to it's default value

Jump to

Keyboard shortcuts

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