Skip to content

Commit

Permalink
Rename LogrusLogger interface to FieldLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
sirupsen committed Mar 17, 2016
1 parent bb78923 commit 897f3dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions logrus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion logrus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 897f3dd

Please sign in to comment.