Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record interface { // AddAttr returns a copy of this Record with the input Attr appended to the // existing ones AddAttr(a ...attr.Attr) Record // Attrs returns the slice of Attr associated to this Record Attrs() []attr.Attr // AttrLen returns the length of the slice of Attr in the Record AttrLen() int // Message returns the string Message associated to this Record Message() string // Time returns the time.Time timestamp associated to this Record Time() time.Time // Level returns the level.Level level associated to this Record Level() level.Level }
Record interface describes the behavior that a Record should have
It expose getter methods for its elements, as well as two helper methods:
- `AddAttr()` will return a copy of this Record with the input Attr appended to the existing ones
- `AttrLen()` will return the length of the attributes in the record
func New ¶
New will return a Record based on the input time.Time `t`, level.Level `lv`, message string `msg` and attributes `attrs`.
If the input time is zero or Unix Time zero, it will set the Records time as now. If the level is nil, level.Info is set instead If there are nil attr.Attr values, they are dismissed
A Record is based on an immutable data structure
Click to show internal directories.
Click to hide internal directories.