alert

package
v0.0.0-...-2eeca3e Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 5 Imported by: 62

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abort

func Abort(err error)

Abort prints error trace and exits

func Fatal

func Fatal(v ...interface{})

Fatal outputs a log message from the arguments, then exits

func Fatalf

func Fatalf(f string, v ...interface{})

Fatalf outputs a formatted log message from the arguments, then exits

func SetOutput

func SetOutput(out io.Writer)

SetOutput configures the output writer for the logger

func Warn

func Warn(v ...interface{})

Warn outputs a log message from the arguments

func Warnf

func Warnf(f string, v ...interface{})

Warnf outputs a formatted log message from the arguments

func Writer

func Writer() *external.Writer

Writer returns a new *external.Writer suitable for injection into 3rd-party logging packages.

Types

type Logger

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

Logger wraps a *log.Logger with some configuration and convenience methods

func NewLogger

func NewLogger(out io.Writer) *Logger

NewLogger returns a *Logger

func (*Logger) Fatal

func (l *Logger) Fatal(v ...interface{})

Fatal outputs a log message from the arguments, then exits

func (*Logger) Fatalf

func (l *Logger) Fatalf(f string, v ...interface{})

Fatalf outputs a formatted log message from the arguments, then exits

func (*Logger) Output

func (l *Logger) Output(skip int, s string)

Output writes the output for a logging event

func (*Logger) SetFlags

func (l *Logger) SetFlags(flags int)

SetFlags sets the output flags for the embedded logger

func (*Logger) SetOutput

func (l *Logger) SetOutput(out io.Writer)

SetOutput updates the embedded logger's output

func (*Logger) Warn

func (l *Logger) Warn(v ...interface{})

Warn outputs a log message from the arguments

func (*Logger) Warnf

func (l *Logger) Warnf(f string, v ...interface{})

Warnf outputs a formatted log message from the arguments

func (*Logger) Write

func (l *Logger) Write(data []byte) (int, error)

Write implements io.Writer and allows the logger to be used as an embedded log writer.

func (*Logger) Writer

func (l *Logger) Writer() *external.Writer

Writer returns a new *external.Writer suitable for injection into 3rd-party logging packages.

Jump to

Keyboard shortcuts

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