logger

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fatal

func Fatal(l Logger, e error)

Fatal is a convenience method that can be used with any Logger to log a fatal error

Types

type Logger

type Logger interface {
	// basic messages, appends a newline (\n) after each entry
	Info(msg string)

	// basic messages, can be custom formatted, similar to fmt.Printf. User needs to add a \n if they want a newline after the log entry
	Infof(msg string, args ...interface{})

	// error messages, indicates to the logger that these messages can be handled differently (different color, special format, email alerts, etc.). The type of logger will determine what to do with these messages. The logger should NOT panic on these messages. Appends a newline (\n) after each entry.
	Error(msg string)

	// error messages, indicates to the logger that these messages can be handled differently (different color, special format, email alerts, etc.). The type of logger will determine what to do with these messages. The logger should NOT panic on these messages. User needs to add a \n if they want a newline after the log entry.
	Errorf(msg string, args ...interface{})
}

Logger is the base logger interface

func MakeBasicLogger

func MakeBasicLogger() Logger

MakeBasicLogger is the factory method

Jump to

Keyboard shortcuts

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