log

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Logger encapsulates the logging device that is used to emit logs and as a receiver that has the logging methods

func NewErrLogger

func NewErrLogger(component string) (log *Logger)

NewErrLogger can be used to instantiate a wrapper logger with a module label with output going stderr

func NewLogger

func NewLogger(component string) (log *Logger)

NewLogger can be used to instantiate a wrapper logger with a module label with output going stdout

func (*Logger) Debug

func (l *Logger) Debug(msg string, args ...interface{})

Debug is a method for output of debugging level messages with a varargs style list of parameters that is formatted as label and then the value in a single list

func (*Logger) Error

func (l *Logger) Error(msg string, args ...interface{}) error

Error is a method for output of error level messages with a varargs style list of parameters that is formatted as label and then the value in a single list

func (*Logger) Fatal

func (l *Logger) Fatal(msg string, args ...interface{})

Fatal is a method for output of fatal level messages with a varargs style list of parameters that is formatted as label and then the value in a single list

func (*Logger) Info

func (l *Logger) Info(msg string, args ...interface{})

Info is a method for output of informational level messages with a varargs style list of parameters that is formatted as label and then the value in a single list

func (*Logger) IsDebug

func (l *Logger) IsDebug() bool

IsDebug returns true in the event that the theshold logging level allows for debugging messages to appear in the output

func (*Logger) IsInfo

func (l *Logger) IsInfo() bool

IsInfo returns true in the event that the theshold logging level allows for informational messages to appear in the output

func (*Logger) IsTrace

func (l *Logger) IsTrace() bool

IsTrace returns true in the event that the theshold logging level allows for trace messages to appear in the output

func (*Logger) IsWarn

func (l *Logger) IsWarn() bool

IsWarn returns true in the event that the theshold logging level allows for warning messages to appear in the output

func (*Logger) Log

func (l *Logger) Log(level int, msg string, args []interface{})

Log is a method for output of parameterized level messages with a varargs style list of parameters that is formatted as label and then the value in a single list

func (*Logger) SetLevel

func (l *Logger) SetLevel(lvl int)

SetLevel can be used to set the threshold for the level of messages that will be output by the logger

func (*Logger) Trace

func (l *Logger) Trace(msg string, args ...interface{})

Trace is a method for output of trace level messages with a varargs style list of parameters that is formatted as label and then the value in a single list

func (*Logger) Warn

func (l *Logger) Warn(msg string, args ...interface{}) error

Warn is a method for output of warning level messages with a varargs style list of parameters that is formatted as label and then the value in a single list

Jump to

Keyboard shortcuts

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