log

package
v4.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: Apache-2.0 Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Discard provides a discard all policy logger
	Discard = New(false, ioutil.Discard)
)

Functions

func Debug

func Debug(format string, args ...interface{})

Debug logs a formatted message at level Debug.

func Error

func Error(format string, args ...interface{})

Error logs a formatted message at level Error.

func Fatal

func Fatal(err error)

Fatal logs an error at level Fatal, and makes the program exit with an error code.

func Info

func Info(format string, args ...interface{})

Info logs a formatted message at level Info.

func SetOutput added in v4.1.0

func SetOutput(w io.Writer)

SetOutput sets output stream

func SetupLogging

func SetupLogging(verbose bool)

SetupLogging redirects global logs to stderr and configures the log level.

func Warn

func Warn(format string, args ...interface{})

Warn logs a formatted message at level Warn.

Types

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

Logger defines a facade for a simple logger

func New

func New(debug bool, w io.Writer) Logger

New creates a logger using the provided writer. The 'debug' argument enables Debug (verbose) output

func NewStdErr

func NewStdErr(debug bool) Logger

NewStdErr creates a logger with stderr output, the argument enables Debug (verbose) output

Jump to

Keyboard shortcuts

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