vlogger

package
v0.0.0-...-a9a91c4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Must be in sequential ascending order based on priority
	// (higher priorities have higher numeric values)
	LL_DEBUG = iota
	LL_INFO
	LL_WARNING
	LL_ERROR
	LL_CRITICAL
	LL_LOGLEVEL_SIZE

	LL_MIN_LEVEL = LL_DEBUG
	LL_MAX_LEVEL = LL_LOGLEVEL_SIZE - 1
)

Variables

This section is empty.

Functions

func Close

func Close()

Close informs the configured loggers that they are being closed and should cleanup (for instance, flushing any queued log messages)

func Critical

func Critical(msg string)

Critical sends a message to the logger object to record critical level statements (these indicate conditions that should never occur and might cause a failure/crash of the executing program or unexpected outcome from the requested action).

func Criticalf

func Criticalf(format string, params ...interface{})

Criticalf formats a message before sending it to the logger object to record critical level statements (these indicate conditions that should never occur and might cause a failure/crash of the executing program or unexpected outcome from the requested action).

func Debug

func Debug(msg string)

Debug sends a message to the logger object to record debug/trace level statements

func Debugf

func Debugf(format string, params ...interface{})

Debugf formats a message before sending it to the logger object to record debug/trace level statements

func Error

func Error(msg string)

Error sends a message to the logger object to record error level statements (these indicate conditions that should not occur and may indicate a failure in performing the requested action).

func Errorf

func Errorf(format string, params ...interface{})

Errorf formats a message before sending it to the logger object to record error level statements (these indicate conditions that should not occur and may indicate a failure in performing the requested action).

func Fatal

func Fatal(msg string)

Fatal sends a CRITICAL message to the logger object and then exits. NOTE: This call should not be made in packages that are meant to serve as libraries for other developers.

func Fatalf

func Fatalf(format string, params ...interface{})

Fatalf sends a formatted CRITICAL message to the logger object and then exits. NOTE: This call should not be made in packages that are meant to serve as libraries for other developers.

func Info

func Info(msg string)

Info sends a message to the logger object to record informational level statements (these should be statements that can normally be logged without causing performance issues).

func Infof

func Infof(format string, params ...interface{})

Infof formats a message before sending it to the logger object to record informational level statements (there should be statements that can normally be logged without causing performance issues).

func Panic

func Panic(msg string)

Panic sends a CRITICAL message to the logger object and then calls panic. NOTE: This call should not be made in packages that are meant to serve as libraries for other developers.

func Panicf

func Panicf(format string, params ...interface{})

Panicf sends a formatted CRITICAL message to the logger object and then calls panic. NOTE: This call should not be made in packages that are meant to serve as libraries for other developers.

func RegisterLogger

func RegisterLogger(minLogLevel, maxLogLevel LogLevel, log Logger)

RegisterLogger must be called to map a concrete logger object with each log level.

func SetLogLevel

func SetLogLevel(level LogLevel)

SetLogLevel sets the current package-level filtering

func Warning

func Warning(msg string)

Warning sends a message to the logger object to record warning level statements (these indication conditions that are unexpected or may cause issues but are not normally going to affect the program execution).

func Warningf

func Warningf(format string, params ...interface{})

Warningf formats a message before sending it to the logger object to record warning level statements (these indication conditions that are unexpected or may cause issues but are not normally going to affect the program execution).

Types

type LogLevel

type LogLevel int

LogLevel is used for global (package-level) filtering of log messages based on their priority (this filtering is applied before all other filtering which might be provided by the concrete logger).

func GetLogLevel

func GetLogLevel() LogLevel

GetLogLevel returns the current package-level filtering

func NewLogLevel

func NewLogLevel(s string) *LogLevel

NewLogLevel converts a string to a log level.

func (LogLevel) MarshalJSON

func (ll LogLevel) MarshalJSON() ([]byte, error)

MarshalJSON converts a LogLevel to a quoted string for JSON output.

func (LogLevel) String

func (ll LogLevel) String() string

String converts a LogLevel to a string for serializing.

func (*LogLevel) UnmarshalJSON

func (ll *LogLevel) UnmarshalJSON(data []byte) error

type Logger

type Logger interface {
	Debug(string)
	Debugf(string, ...interface{})
	Info(string)
	Infof(string, ...interface{})
	Warning(string)
	Warningf(string, ...interface{})
	Error(string)
	Errorf(string, ...interface{})
	Critical(string)
	Criticalf(string, ...interface{})
	GetLogLevel() syslog.Priority
	SetLogLevel(syslog.Priority)
	Close()
}

Generic interface that all concrete loggers must implement. Using this interface directly isolates user code from a particular logger implementation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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