Merge pull request #178 from mattbaird/patch-1

proper use of TextFormatter in documentation
This commit is contained in:
Simon Eskildsen 2015-05-12 12:38:02 -05:00
commit 52919f182f
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"}
"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} "time":"2014-03-10 19:57:38.562543128 -0400 EDT"}
``` ```
With the default `log.Formatter = new(logrus.TextFormatter)` when a TTY is not With the default `log.Formatter = new(&log.TextFormatter{})` when a TTY is not
attached, the output is compatible with the attached, the output is compatible with the
[logfmt](http://godoc.org/github.com/kr/logfmt) format: [logfmt](http://godoc.org/github.com/kr/logfmt) format:
@ -269,7 +269,7 @@ init() {
log.SetFormatter(logrus.JSONFormatter) log.SetFormatter(logrus.JSONFormatter)
} else { } else {
// The TextFormatter is default, you don't actually have to do this. // The TextFormatter is default, you don't actually have to do this.
log.SetFormatter(logrus.TextFormatter) log.SetFormatter(&log.TextFormatter{})
} }
} }
``` ```