sirupsen / logrus

Structured, pluggable logging for Go.
MIT License
24.8k stars 2.27k forks source link

FieldLogger interface is dependent on Entry struct #1329

Closed Rutori closed 2 years ago

Rutori commented 2 years ago

In logrus.FieldLogger interface methods WithField, WithFields and WithError return *logrus.Entry which is too specific, if we assume that we will always be using the returned value as an instance of logrus.FieldLogger, e.g. logger.WithField(foo, bar).Error(err)

I suggest changing the return type of the mentioned methods to FieldLogger

dgsb commented 2 years ago

We cannot do that, it's a major non-backward compatible change.