logger

package
v0.0.0-...-a41b70d Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is a multi-level logger, supporting trace, info, warning and error levels that can be enabled/disabled independently.

func New

func New(traceDest, infoDest, warningDest, errorDest io.Writer) *Logger

New returns a new logger instance configured with the given destination for each level. Setting any destination to nil will disable the logging (log will be sent to ioutil.Discard). Common destinations are os.Stdout and os.Stderr.

func (*Logger) ERROR

func (l *Logger) ERROR(format string, a ...interface{})

ERROR logs error messages, used to report actual issues that might need to be fixed.

func (*Logger) INFO

func (l *Logger) INFO(format string, a ...interface{})

INFO logs informational messages, used for reporting back informational messages that are generally useful.

func (*Logger) TRACE

func (l *Logger) TRACE(format string, a ...interface{})

TRACE logs trace messages, used mostly for debugging.

func (*Logger) WARNING

func (l *Logger) WARNING(format string, a ...interface{})

WARNING logs warning messages, used to report anything that might be problematic but is not considered an error.

Jump to

Keyboard shortcuts

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