Documentation
¶
Index ¶
- func AsyncDiscard() chan<- *Entry
- func AsyncLogger() (chan<- *Entry, chan bool)
- type Context
- func (c Context) Debug(s string, v ...interface{}) *Entry
- func (c Context) Error(s string, v ...interface{}) *Entry
- func (c Context) Fatal(s string, v ...interface{}) *Entry
- func (c Context) Info(s string, v ...interface{}) *Entry
- func (c Context) Notify(l Level, s string, v ...interface{}) *Entry
- func (c Context) Warn(s string, v ...interface{}) *Entry
- func (c Context) WithError(err error) Context
- func (c Context) WithExtra(name string, value interface{}) Context
- func (c Context) WithField(name string, value interface{}) Context
- func (c Context) WithFields(f Fields) Context
- type Entry
- type Fields
- type Level
- type Map
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
Context holds stateful information for notifications
func WithExtra ¶
WithExtra creates a new context with an extra property
func WithField ¶
WithField creates a new context with a single field
func WithFields ¶
WithFields creates a new context with multiple fields
func (Context) Debug ¶
Debug creates a new debugging notification
func (Context) Error ¶
Error creates a new info notification
func (Context) Fatal ¶
Fatal creates a new info notification
func (Context) Info ¶
Info creates a new info notification
func (Context) Notify ¶
Notify creates a new notification entry
func (Context) Warn ¶
Warn creates a new info notification
func (Context) WithError ¶
WithError extedns the current context with an error
func (Context) WithExtra ¶
WithExtra adds additional information which is only used internally
func (Context) WithField ¶
WithField extends the current context with anohter field
type Entry ¶
Entry is a single instance of a notification
type Level ¶
type Level uint32
Level is the notification level
const ( // LevelDebug is for development notifications LevelDebug Level = iota // LevelInfo is for notifictions which are non-critical LevelInfo // LevelWarn is for notifications which may be troublesome LevelWarn // LevelError is for notifications which is crtical LevelError // LevelFatal is for notifications which are fatal LevelFatal )
func (Level) MarshalJSON ¶
MarshalJSON returns the notification level as a string
Source Files
¶
- context.go
- entry.go
- notify.go
- util.go