Documentation
¶
Index ¶
- Variables
- func Alert(ctx context.Context, xs ...interface{})
- func Critical(ctx context.Context, xs ...interface{})
- func Debug(ctx context.Context, xs ...interface{})
- func Emergency(ctx context.Context, xs ...interface{})
- func Error(ctx context.Context, xs ...interface{})
- func Info(ctx context.Context, xs ...interface{})
- func Notice(ctx context.Context, xs ...interface{})
- func Warning(ctx context.Context, xs ...interface{})
- type Event
- type F
- type Fer
- type Filter
- type FilterFunc
- type Formatter
- type Logger
- func (l *Logger) Alert(ctx context.Context, xs ...interface{})
- func (l *Logger) Critical(ctx context.Context, xs ...interface{})
- func (l *Logger) Debug(ctx context.Context, xs ...interface{})
- func (l *Logger) Emergency(ctx context.Context, xs ...interface{})
- func (l *Logger) Error(ctx context.Context, xs ...interface{})
- func (l *Logger) Info(ctx context.Context, xs ...interface{})
- func (l *Logger) Log(ctx context.Context, p Priority, xs ...interface{})
- func (l *Logger) Notice(ctx context.Context, xs ...interface{})
- func (l *Logger) Warning(ctx context.Context, xs ...interface{})
- type Priority
- type TextFormatter
- type WriterFilter
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultTimeFormat represents the way in which time will be formatted by default DefaultTimeFormat = time.RFC3339 )
var NilFilter = FilterFunc(func(_ context.Context, e Event) bool { return true })
NilFilter is safe to return as a Filter, but does nothing
Functions ¶
Types ¶
type FilterFunc ¶
FilterFunc allows simple functions to implement the Filter interface
type Formatter ¶
Formatter defines the formatting of events
var DefaultFormatter Formatter
DefaultFormatter is the default way in which to format events
func NewTextFormatter ¶
func NewTextFormatter() Formatter
NewTextFormatter returns a Formatter that outputs as text.
type Logger ¶
Logger holds the current priority and list of filters
var DefaultLogger *Logger
DefaultLogger is the default implementation of Logger
type Priority ¶
type Priority int
Priority represents the importance of an Event.
const ( // PriEmergency is the emergency priority, and is the highest. PriEmergency Priority = iota // PriAlert is the alert priority PriAlert // PriCritical is the critical priority PriCritical // PriError is the error priority. PriError // PriWarning is the warning priority PriWarning // PriNotice is the notice priority PriNotice // PriInfo is the info priority PriInfo // PriDebug is the debug priority. PriDebug )
type TextFormatter ¶
type TextFormatter struct {
TimeFormat string
}
TextFormatter formats events as key value pairs. Any remaining text not wrapped in an instance of `F` will be placed at the end.
type WriterFilter ¶
WriterFilter implements a filter, which arbitrarily writes to an io.Writer
func NewWriterFilter ¶
func NewWriterFilter(out io.Writer, format Formatter) *WriterFilter
NewWriterFilter creates a filter to add to the chain