readme: add setting level instructions
This commit is contained in:
@@ -71,6 +71,7 @@ for the environment.
|
|||||||
Logrus has six levels: Debug, Info, Warning, Error, Fatal and Panic.
|
Logrus has six levels: Debug, Info, Warning, Error, Fatal and Panic.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
|
log.Debug("Useful debugging information.")
|
||||||
log.Info("Something noteworthy happened!")
|
log.Info("Something noteworthy happened!")
|
||||||
log.Warn("You should probably take a look at this.")
|
log.Warn("You should probably take a look at this.")
|
||||||
log.Error("Something failed but I'm not quitting.")
|
log.Error("Something failed but I'm not quitting.")
|
||||||
@@ -78,6 +79,13 @@ log.Fatal("Bye.")
|
|||||||
log.Panic("I'm bailing.")
|
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
|
#### Entries
|
||||||
|
|
||||||
Besides the fields added with `WithField` or `WithFields` some fields are
|
Besides the fields added with `WithField` or `WithFields` some fields are
|
||||||
|
|||||||
Reference in New Issue
Block a user