update to github.com/sirupsen/logrus v1.0.0

Signed-off-by: Andrew Pennebaker <apennebaker@datapipe.com>
This commit is contained in:
Andrew Pennebaker
2017-07-06 16:42:09 -05:00
committed by Derek McGowan
parent dd7642fc1c
commit 1d2a079f08
62 changed files with 2001 additions and 235 deletions

View File

@@ -0,0 +1,30 @@
package main
import (
"github.com/sirupsen/logrus"
"gopkg.in/gemnasium/logrus-airbrake-hook.v2"
)
var log = logrus.New()
func init() {
log.Formatter = new(logrus.TextFormatter) // default
log.Hooks.Add(airbrake.NewHook(123, "xyz", "development"))
}
func main() {
log.WithFields(logrus.Fields{
"animal": "walrus",
"size": 10,
}).Info("A group of walrus emerges from the ocean")
log.WithFields(logrus.Fields{
"omg": true,
"number": 122,
}).Warn("The group's number increased tremendously!")
log.WithFields(logrus.Fields{
"omg": true,
"number": 100,
}).Fatal("The ice breaks!")
}