examples: change size to integer

This commit is contained in:
Simon Eskildsen 2014-03-14 16:17:18 -04:00
parent c26c4c5ff6
commit 7d02fa59d7
2 changed files with 10 additions and 10 deletions

View File

@ -13,16 +13,16 @@ or Splunk:
```json ```json
{"animal":"walrus","level":"info","msg":"A group of walrus emerges from the {"animal":"walrus","level":"info","msg":"A group of walrus emerges from the
ocean","size":"10","time":"2014-03-10 19:57:38.562264131 -0400 EDT"} ocean","size":10,"time":"2014-03-10 19:57:38.562264131 -0400 EDT"}
{"level":"warning","msg":"The group's number increased tremendously!", {"level":"warning","msg":"The group's number increased tremendously!",
"number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"} "number":122,"omg":true,"time":"2014-03-10 19:57:38.562471297 -0400 EDT"}
{"animal":"walrus","level":"info","msg":"A giant walrus appears!", {"animal":"walrus","level":"info","msg":"A giant walrus appears!",
"size":"10","time":"2014-03-10 19:57:38.562500591 -0400 EDT"} "size":10,"time":"2014-03-10 19:57:38.562500591 -0400 EDT"}
{"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.", {"animal":"walrus","level":"info","msg":"Tremendously sized cow enters the ocean.",
"size":"9","time":"2014-03-10 19:57:38.562527896 -0400 EDT"} "size":9,"time":"2014-03-10 19:57:38.562527896 -0400 EDT"}
{"level":"fatal","msg":"The ice breaks!","number":100,"omg":true, {"level":"fatal","msg":"The ice breaks!","number":100,"omg":true,
"time":"2014-03-10 19:57:38.562543128 -0400 EDT"} "time":"2014-03-10 19:57:38.562543128 -0400 EDT"}
@ -32,10 +32,10 @@ With the default `log.Formatter = new(logrus.TextFormatter)` when a TTY is not
attached: attached:
```text ```text
time='2014-03-14 13:00:31.751756799 -0400 EDT' level='info' msg='A group of walrus emerges from the ocean' animal='walrus' size='10' time='2014-03-14 13:00:31.751756799 -0400 EDT' level='info' msg='A group of walrus emerges from the ocean' animal='walrus' size=10
time='2014-03-14 13:00:31.751994265 -0400 EDT' level='warning' msg='The group's number increased tremendously!' omg=true number=122 time='2014-03-14 13:00:31.751994265 -0400 EDT' level='warning' msg='The group's number increased tremendously!' omg=true number=122
time='2014-03-14 13:00:31.752018319 -0400 EDT' level='info' msg='A giant walrus appears!' animal='walrus' size='10' time='2014-03-14 13:00:31.752018319 -0400 EDT' level='info' msg='A giant walrus appears!' animal='walrus' size=10
time='2014-03-14 13:00:31.752034139 -0400 EDT' level='info' msg='Tremendously sized cow enters the ocean.' animal='walrus' size='9' time='2014-03-14 13:00:31.752034139 -0400 EDT' level='info' msg='Tremendously sized cow enters the ocean.' animal='walrus' size=9
time='2014-03-14 13:00:31.752048504 -0400 EDT' level='fatal' msg='The ice breaks!' omg=true number=100 time='2014-03-14 13:00:31.752048504 -0400 EDT' level='fatal' msg='The ice breaks!' omg=true number=100
``` ```

View File

@ -11,7 +11,7 @@ func main() {
for { for {
log.WithFields(logrus.Fields{ log.WithFields(logrus.Fields{
"animal": "walrus", "animal": "walrus",
"size": "10", "size": 10,
}).Print("A group of walrus emerges from the ocean") }).Print("A group of walrus emerges from the ocean")
log.WithFields(logrus.Fields{ log.WithFields(logrus.Fields{
@ -21,12 +21,12 @@ func main() {
log.WithFields(logrus.Fields{ log.WithFields(logrus.Fields{
"animal": "walrus", "animal": "walrus",
"size": "10", "size": 10,
}).Print("A giant walrus appears!") }).Print("A giant walrus appears!")
log.WithFields(logrus.Fields{ log.WithFields(logrus.Fields{
"animal": "walrus", "animal": "walrus",
"size": "9", "size": 9,
}).Print("Tremendously sized cow enters the ocean.") }).Print("Tremendously sized cow enters the ocean.")
log.WithFields(logrus.Fields{ log.WithFields(logrus.Fields{