docs: add documentation for godoc

This commit is contained in:
Simon Eskildsen
2014-03-12 10:34:29 -04:00
parent 1e8a799618
commit d02c5b387e
4 changed files with 72 additions and 11 deletions
+10
View File
@@ -1,5 +1,15 @@
package logrus
// The Formatter interface is used to implement a custom Formatter. It takes an
// `Entry`. It exposes all the fields, including the default ones:
//
// * `entry.Data["msg"]`. The message passed from Info, Warn, Error ..
// * `entry.Data["time"]`. The timestamp.
// * `entry.Data["level"]. The level the entry was logged at.
//
// Any additional fields added with `WithField` or `WithFields` are also in
// `entry.Data`. Format is expected to return an array of bytes which are then
// logged to `logger.Out`.
type Formatter interface {
Format(*Entry) ([]byte, error)
}