simplelog

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FATAL
	RESULT
	WARNING
	INFO
	VERBOSE
	DEBUG
)

verbosity

Variables

View Source
var (
	// GetVerbosity returns the current verbosity level
	GetVerbosity func() int

	// LoggerFatal is written to for FATAL level logging
	LoggerFatal = log.New(os.Stderr, "[FATAL] ", 0)

	// LoggerResult is written to for RESULT level logging
	LoggerResult = log.New(os.Stdout, "", 0)

	// LoggerWarning is written to for WARNING level logging
	LoggerWarning = log.New(os.Stderr, "[!] ", 0)

	// LoggerInfo is written to for INFO level logging
	LoggerInfo = log.New(os.Stdout, "[+] ", 0)

	// LoggerVerbose is written to for VERBOSE level logging
	LoggerVerbose = log.New(os.Stdout, "[>] ", 0)

	// LoggerDebug is written to for DEBUG level logging
	LoggerDebug = log.New(os.Stdout, "[D] ", 0)
)

Functions

func D

func D(v ...interface{})

D logs DEBUG messages to stdout

func F

func F(v ...interface{})

F logs FATAL errors to stderr and calls os.Exit(1)

func FatalOnErr

func FatalOnErr(s string, e error)

FatalOnErr logs and calls os.Exit(1) if the error != nil

func GetVerbosityWith

func GetVerbosityWith(v func() int)

GetVerbosityWith sets the function used to load the current verbosity level

func I

func I(v ...interface{})

I logs INFO to stdout

func R

func R(v ...interface{})

R logs RESULTS to stdout

func V

func V(v ...interface{})

V logs VERBOSE messages to stdout

func W

func W(v ...interface{})

W logs WARNINGS to stderr

func WarnOnErr

func WarnOnErr(s string, e error)

WarnOnErr logs the error as a WARNING if the error != nil

Types

This section is empty.

Jump to

Keyboard shortcuts

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