From 107695ee5077e8328d4cab59d87b2c8fd073eca7 Mon Sep 17 00:00:00 2001 From: Mawuli Adzoe Date: Mon, 7 Sep 2015 09:10:15 +0000 Subject: [PATCH 1/2] Add godoc summary --- doc.go | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 doc.go diff --git a/doc.go b/doc.go new file mode 100644 index 0000000..445dc55 --- /dev/null +++ b/doc.go @@ -0,0 +1,6 @@ +/* +Package logrus is a structured logger for Go, completely API compatible with the standard library logger. + +For a full guide visit https://github.com/Sirupsen/logrus +*/ +package logrus From 4b9a6460396c33846bd7ecc296e39e984bf0f363 Mon Sep 17 00:00:00 2001 From: Mawuli Adzoe Date: Mon, 7 Sep 2015 09:10:36 +0000 Subject: [PATCH 2/2] Add sample code --- doc.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc.go b/doc.go index 445dc55..dddd5f8 100644 --- a/doc.go +++ b/doc.go @@ -1,6 +1,26 @@ /* Package logrus is a structured logger for Go, completely API compatible with the standard library logger. + +The simplest way to use Logrus is simply the package-level exported logger: + + package main + + import ( + log "github.com/Sirupsen/logrus" + ) + + func main() { + log.WithFields(log.Fields{ + "animal": "walrus", + "number": 1, + "size": 10, + }).Info("A walrus appears") + } + +Output: + time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10 + For a full guide visit https://github.com/Sirupsen/logrus */ package logrus