Coder Social home page Coder Social logo

Comments (6)

mwitkow avatar mwitkow commented on May 22, 2024

gTBH it's relatively easy to pass in an Entry using https://godoc.org/github.com/sirupsen/logrus#NewEntry

What are the benefitsof logrus.FieldLogger above that?

from go-grpc-middleware.

sagikazarmark avatar sagikazarmark commented on May 22, 2024

It's an interface fulfilled by logrus.Entry and logrus.Logger as well. Also, I don't see how using Entry or Logger internals is necessary, so hiding those behind the FieldLogger API makes the code more stable by depending on a contract IMHO.

from go-grpc-middleware.

mwitkow avatar mwitkow commented on May 22, 2024

Sounds sensible. Wanna submit a PR? :)

from go-grpc-middleware.

sagikazarmark avatar sagikazarmark commented on May 22, 2024

Sure, but don't know when I will find some time to do so, so feel free to pick it if you want.

from go-grpc-middleware.

mrbanzai avatar mrbanzai commented on May 22, 2024

I started to take a stab at this, but the payload interceptor expects to be able to access the Data variable of a logrus.Entry returned from Extract:

logEntry := entry.WithFields(Extract(ctx).Data)

It might be possible to return a logrus.Entry for a logrus.FieldLogger by calling logrus.WithFields(logrus.Fields{}), but that feels dirty.

from go-grpc-middleware.

bwplotka avatar bwplotka commented on May 22, 2024

This is pretty old and we know have v2 code with different structure. Let us know if this is still important, we can reopen.

from go-grpc-middleware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.