From ac6019137d5b10d02c7acac4f63fa22091b9933d Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Tue, 28 Nov 2017 16:28:48 +0100 Subject: Fix imports for github.com/sirupsen/logrus Change-Id: I84f2e45e5ff188a2a7a80cf69f607b44486c1754 Signed-off-by: Ondrej Fabry --- .../sirupsen/logrus/examples/hook/hook.go | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 vendor/github.com/sirupsen/logrus/examples/hook/hook.go (limited to 'vendor/github.com/sirupsen/logrus/examples/hook/hook.go') diff --git a/vendor/github.com/sirupsen/logrus/examples/hook/hook.go b/vendor/github.com/sirupsen/logrus/examples/hook/hook.go new file mode 100644 index 0000000..c8470c3 --- /dev/null +++ b/vendor/github.com/sirupsen/logrus/examples/hook/hook.go @@ -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!") +} -- cgit 1.2.3-korg