readme: add setting level instructions

This commit is contained in:
Simon Eskildsen 2014-03-06 21:49:10 -05:00
parent 8492d88e94
commit 7769e38bec
1 changed files with 8 additions and 0 deletions

View File

@ -71,6 +71,7 @@ for the environment.
Logrus has six levels: Debug, Info, Warning, Error, Fatal and Panic.
```go
log.Debug("Useful debugging information.")
log.Info("Something noteworthy happened!")
log.Warn("You should probably take a look at this.")
log.Error("Something failed but I'm not quitting.")
@ -78,6 +79,13 @@ log.Fatal("Bye.")
log.Panic("I'm bailing.")
```
You can set the logging level:
```go
// Will log anything that is info or above, default.
logrus.Level = LevelInfo
```
#### Entries
Besides the fields added with `WithField` or `WithFields` some fields are