log

package
v0.0.0-...-82180e8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FATAL     = 5
	ERROR     = 4
	WARN      = 3
	IMPORTANT = 2
	INFO      = 1
	DEBUG     = 0
)

These are a consistent set of error codes instead of using random non-zero integers

Variables

View Source
var Log *logger

Log is the program's logging package. It is self-initialized (with init() func) so we don't need to do it manually in the client code. It's a dependency the program cannot function without. It's a global variable, because it's a small program, hence it's easier to manage it from a central place. And we don't mutate it's state more than once, only at startup, to set debug and silent modes.

LogColors sets the color for each type of logging output

Functions

func NewNoopLogger

func NewNoopLogger()

NewNoopLogger will mutate existing logger, ensuring no output will be sent to stdout useful for testing.

func SetDebug

func SetDebug(d bool) *logger

func SetSilent

func SetSilent(s bool) *logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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