log

package module
v0.0.0-...-f75736f Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelWTF level = iota - 1
	LevelInfo
	LevelFatal
	LevelError
	LevelWarning
	LevelDebug
	LevelVerbose
)

Variables

This section is empty.

Functions

func AddListener

func AddListener(id string, messageChannel chan string) error

AddListener will start broadcasting all log entries to the provided channe

func Debug

func Debug(args ...interface{})

Debug will create a debug log entry

func Error

func Error(args ...interface{})

Error will create an error log entry

func Fatal

func Fatal(args ...interface{})

Fatal will create a fatal log entry and panic

func GetLevelFromString

func GetLevelFromString(levelString string) level

func Info

func Info(args ...interface{})

Info will create a log entry you intentionally want to display to users

func RemoveListener

func RemoveListener(id string)

RemoveListener removes the provided ID from the list of listeners

func SetLogLevel

func SetLogLevel(newLevel level)

SetLogLevel will set the level of logging verbosity. Default = LevelWarning

func SetTimeout

func SetTimeout(newTimeout time.Duration)

SetTimeout sets the time until we stop trying to notify a listener and discard the log

func ToConsole

func ToConsole(logToConsole bool)

ToConsole controls whether to log to console or not

func Verbose

func Verbose(args ...interface{})

Verbose will create a verbose log entry

func WTF

func WTF(args ...interface{})

WTF should only be used for debugging and will ALWAYS generate a log entry despite the logging level

func Warning

func Warning(args ...interface{})

Warning will create a warning log entry

Types

This section is empty.

Jump to

Keyboard shortcuts

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