log

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 3 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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