mirror of https://github.com/sirupsen/logrus.git
Rename LogrusLogger interface to FieldLogger
This commit is contained in:
parent
bb78923f27
commit
897f3dddf1
|
@ -108,10 +108,8 @@ type StdLogger interface {
|
||||||
Panicln(...interface{})
|
Panicln(...interface{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logrus logger interface generalizes Entry and Logger types, so you can take any of these
|
// The FieldLogger interface generalizes the Entry and Logger types
|
||||||
type LogrusLogger interface {
|
type FieldLogger interface {
|
||||||
// we can return LogrusLogger here, but this will require many changes and will
|
|
||||||
// possible break backward compatiblity
|
|
||||||
WithField(key string, value interface{}) *Entry
|
WithField(key string, value interface{}) *Entry
|
||||||
WithFields(fields Fields) *Entry
|
WithFields(fields Fields) *Entry
|
||||||
WithError(err error) *Entry
|
WithError(err error) *Entry
|
||||||
|
|
|
@ -346,7 +346,7 @@ func TestLoggingRace(t *testing.T) {
|
||||||
// Compile test
|
// Compile test
|
||||||
func TestLogrusInterface(t *testing.T) {
|
func TestLogrusInterface(t *testing.T) {
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
fn := func(l LogrusLogger) {
|
fn := func(l FieldLogger) {
|
||||||
b := l.WithField("key", "value")
|
b := l.WithField("key", "value")
|
||||||
b.Debug("Test")
|
b.Debug("Test")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue