errors

package
v0.0.0-...-0d1cb40 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2019 License: Apache-2.0 Imports: 3 Imported by: 111

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
}

Config defines the error configuration, currently no configuration options are available.

type Err

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

Err contains a single error

func (Err) Error

func (e Err) Error() string

String returns the message of this error

func (Err) Priority

func (e Err) Priority() Priority

Priority returns the priority of this error

type Errors

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

Errors contains a list of Error

func New

func New(c *Config) *Errors

New creates an empty error container

func (*Errors) Alert

func (e *Errors) Alert(format string, a ...interface{}) error

Alert log an error with severity Alert

func (*Errors) Append

func (e *Errors) Append(err *Errors) error

Append add all Errors to existing Errors

func (*Errors) Crit

func (e *Errors) Crit(format string, a ...interface{}) error

Crit log an error with severity Critical

func (*Errors) Debug

func (e *Errors) Debug(format string, a ...interface{}) error

Debug log an error with severity Debug

func (*Errors) Emerg

func (e *Errors) Emerg(format string, a ...interface{}) error

Emerg log an error with severity Emergency

func (*Errors) Err

func (e *Errors) Err(format string, a ...interface{}) error

Err log an error with severity Error

func (*Errors) Info

func (e *Errors) Info(format string, a ...interface{}) error

Info log an error with severity Info

func (*Errors) IsError

func (e *Errors) IsError() bool

IsError returns true on one or more errors

func (*Errors) List

func (e *Errors) List(p ...Priority) []Err

List returns all errors of a given priority, if no priority is given all errors are returned.

func (*Errors) Notice

func (e *Errors) Notice(format string, a ...interface{}) error

Notice log an error with severity Notice

func (*Errors) Priority

func (e *Errors) Priority() Priority

Priority returns the priority of this error

func (*Errors) Warning

func (e *Errors) Warning(format string, a ...interface{}) error

Warning log an error with severity Warning

type Priority

type Priority int

Priority defines how an error should be threaded

const (
	Unknown Priority = iota
	Debug
	Info
	Notice
	Warning
	Error
	Critical
	Alert
	Emergency
)

Priorities that can be used to create and list errors

func (Priority) String

func (i Priority) String() string

Jump to

Keyboard shortcuts

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