Giter Club home page Giter Club logo

Comments (7)

taoj-action avatar taoj-action commented on August 16, 2024 1

zap is interesting. https://github.com/uber-go/zap I will take a look on this.

from vmware-go-kcl.

Sytten avatar Sytten commented on August 16, 2024 1

I will write a logrus hook for that.

from vmware-go-kcl.

taoj-action avatar taoj-action commented on August 16, 2024

The only issue is golang log does not provide enough abstraction on common functionalities.
https://golang.org/pkg/log/

We had a very long debate on which logging package to use and finally settled down to logrus. It is quite extensible and our internal codebase uses customized log library with compatible interface as logrus.

https://medium.com/@_orcaman/most-imported-golang-packages-some-insights-fb12915a07

from vmware-go-kcl.

taoj-action avatar taoj-action commented on August 16, 2024

The major advantage of using logrus is that it provides structured logger for Go. The logging result can be easily ingested into ElasticSearch for log analysis.
https://github.com/sirupsen/logrus

from vmware-go-kcl.

Sytten avatar Sytten commented on August 16, 2024

Yeah I agree that the golang log is not good enough. We happen to use zap (which is also a structured logger). The problem is mainly that it is a bit painful (but doable with hooks) to redirect logs from logrus to zap. What I have seen libraries doing (like AWS SDK) is to create a custom logging interface (with a default if needed) that the users can then implement with their logger of choice.

from vmware-go-kcl.

Sytten avatar Sytten commented on August 16, 2024

I finally wrote the hook https://github.com/Sytten/logrus-zap-hook, though I think an interface would be better ;)

from vmware-go-kcl.

taoj-action avatar taoj-action commented on August 16, 2024

PR: #43
for adding support on both logrus and zap logger.

from vmware-go-kcl.

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.