From 897f3dddf1e774a8b7cfa529af7b596e01bbc6f0 Mon Sep 17 00:00:00 2001 From: Simon Eskildsen Date: Thu, 17 Mar 2016 14:07:00 +0000 Subject: [PATCH] Rename LogrusLogger interface to FieldLogger --- logrus.go | 6 ++---- logrus_test.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/logrus.go b/logrus.go index 712199659..e59669111 100644 --- a/logrus.go +++ b/logrus.go @@ -108,10 +108,8 @@ type StdLogger interface { Panicln(...interface{}) } -// Logrus logger interface generalizes Entry and Logger types, so you can take any of these -type LogrusLogger interface { - // we can return LogrusLogger here, but this will require many changes and will - // possible break backward compatiblity +// The FieldLogger interface generalizes the Entry and Logger types +type FieldLogger interface { WithField(key string, value interface{}) *Entry WithFields(fields Fields) *Entry WithError(err error) *Entry diff --git a/logrus_test.go b/logrus_test.go index b4e9ded96..bfc478055 100644 --- a/logrus_test.go +++ b/logrus_test.go @@ -346,7 +346,7 @@ func TestLoggingRace(t *testing.T) { // Compile test func TestLogrusInterface(t *testing.T) { var buffer bytes.Buffer - fn := func(l LogrusLogger) { + fn := func(l FieldLogger) { b := l.WithField("key", "value") b.Debug("Test") }