Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultUserFieldCapacity = 5
View Source
const (
// The field set by WithError function
FieldError = "err"
)
Variables ¶
Levels ordered least severe to most severe
Functions ¶
This section is empty.
Types ¶
type Level ¶
type Level int
func ParseLevel ¶
func (Level) MarshalJSON ¶
func (*Level) UnmarshalJSON ¶
type Logger ¶
type Logger interface { WithOutlet(outlet Outlet, level Level) Logger ReplaceField(field string, val interface{}) Logger WithField(field string, val interface{}) Logger WithFields(fields Fields) Logger WithError(err error) Logger Log(level Level, msg string) Debug(msg string) Info(msg string) Warn(msg string) Error(msg string) Printf(format string, args ...interface{}) }
func NewNullLogger ¶
func NewNullLogger() Logger
func NewStderrDebugLogger ¶
func NewStderrDebugLogger() Logger
func NewTestLogger ¶
type Outlet ¶
type Outlet interface { // Write the entry to the destination. // // Logger waits for all outlets to return from WriteEntry() before returning from the log call. // An implementation of Outlet must assert that it does not block in WriteEntry. // Otherwise, it will slow down the program. // // Note: os.Stderr is also used by logger.Logger for reporting errors returned by outlets // => you probably don't want to log there WriteEntry(entry Entry) error }
An outlet receives log entries produced by the Logger and writes them to some destination.
type Outlets ¶
type Outlets struct {
// contains filtered or unexported fields
}
func NewOutlets ¶
func NewOutlets() *Outlets
func (*Outlets) GetLoggerErrorOutlet ¶
Return the first outlet added to this Outlets list using Add() with minLevel <= Error. If no such outlet is in this Outlets list, a discarding outlet is returned.
Click to show internal directories.
Click to hide internal directories.