logger

package module
v0.0.0-...-1af7188 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: BSD-2-Clause Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DebugLevel   = 1
	InfoLevel    = 0
	WarningLevel = -1
	ErrorLevel   = -2
	Disabled     = -3
)

Different log levels

Variables

This section is empty.

Functions

func Debug

func Debug(message ...interface{})

Debug sends the given strings to the debug log channel.

func DebugSync

func DebugSync(message ...interface{})

DebugSync writes a message to the debug log in a synchronous manner, if debug level enabled.

func Error

func Error(message ...interface{})

Error sends the given string arguments to the error log channel.

func ErrorSync

func ErrorSync(message ...interface{})

ErrorSync writes a message to the error log in a synchronous manner, if error level enabled.

func GetLogLevel

func GetLogLevel() int

GetLogLevel returns the current log level

func GetLogLevelID

func GetLogLevelID(level string) int

GetLogLevelID determines what log verbosity to use. level - usually this is a client input.

func Info

func Info(message ...interface{})

Info sends the given string arguments to the info log channel.

func InfoSync

func InfoSync(message ...interface{})

InfoSync writes a message to the info log in a synchronous manner, if info level enabled.

func InitNewLogger

func InitNewLogger(outInterface io.Writer, level int)

InitNewLogger sets the io.Writer interface as an output for the loggers and spawns a goroutine for each of the available loggers.

func SetLogLevel

func SetLogLevel(level int)

SetLogLevel sets the log level to output.

func Warning

func Warning(message ...interface{})

Warning sends the given string arguments to the warning log channel.

func WarningSync

func WarningSync(message ...interface{})

WarningSync writes a message to the warning log in a synchronous manner, if warning level enabled.

Types

This section is empty.

Jump to

Keyboard shortcuts

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