Add readme paragraph about package exported funcs.

This commit is contained in:
Antoine Grondin 2014-07-23 16:48:53 -04:00
parent e5621dca87
commit 9a0c9801d6
1 changed files with 8 additions and 1 deletions

View File

@ -78,6 +78,13 @@ func main() {
}
```
#### Package logging
Alike the stdlib logger, logrus exposes functions that you can use to log
to a default global logger. This is convenient to avoid passing a
`logrus.Logger` thorough your app's packages; you can simply setup `logrus
from your main package and use the package function directly accross your app.
#### Fields
Logrus encourages careful, structured logging though logging fields instead of
@ -91,7 +98,7 @@ log = logrus.New()
log.WithFields(logrus.Fields{
"event": event,
"topic": topic,
"key": key
"key": key,
}).Fatal("Failed to send event")
```