report

package
v5.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT, + 1 more Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Level   logrus.Level
	Message string
	Context map[string]interface{}
	Time    time.Time
}

Entry ...

type Report

type Report struct {
	Out      io.Writer
	LogLevel logrus.Level
	// contains filtered or unexported fields
}

Report reports debug, warning, & errors

func New

func New() Report

New returns new report w/ log level preconfigured

func (*Report) AddEntry

func (r *Report) AddEntry(e Entry)

AddEntry adds given entry to report

func (*Report) Flush

func (r *Report) Flush() error

Flush pops entries from list and writes them

func (*Report) HasErrors

func (r *Report) HasErrors() bool

HasErrors returns true if there are any error entries in the report

func (*Report) HasWarnings

func (r *Report) HasWarnings() bool

HasWarnings returns true if there are any warnings entries in the report

type Writer

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

Writer exposes methods for adding entries to a report

func NewWriter

func NewWriter(report *Report) Writer

NewWriter returns a new writer instance with context initialized

func (Writer) Debug

func (w Writer) Debug(msg string)

Debug logs debug messages

func (Writer) Debugf

func (w Writer) Debugf(msg string, a ...interface{})

Debugf logs debug messages

func (Writer) Error

func (w Writer) Error(msg string)

Error logs error

func (Writer) Errorf

func (w Writer) Errorf(msg string, a ...interface{})

Errorf logs error

func (Writer) Fatal

func (w Writer) Fatal(msg string)

Fatal logs fatal error and quits

func (Writer) Fatalf

func (w Writer) Fatalf(msg string, a ...interface{})

Fatalf logs fatal error and quits

func (Writer) Info

func (w Writer) Info(msg string)

Info logs information

func (Writer) Infof

func (w Writer) Infof(msg string, a ...interface{})

Infof logs info

func (Writer) Warn

func (w Writer) Warn(msg string)

Warn logs warning

func (Writer) Warnf

func (w Writer) Warnf(msg string, a ...interface{})

Warnf logs warning

func (Writer) WithValue

func (w Writer) WithValue(key string, val interface{}) Writer

WithValue returns a new writer instance with KV pair added

Jump to

Keyboard shortcuts

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