Code Monkey home page Code Monkey logo

Comments (5)

novln avatar novln commented on May 21, 2024 1

Hello,

First of all, thank you for this amazing router: it's the most elegant and minimalist solution I've found for the moment.

I have a question however for the v2 release of chi, would it be possible to link a LogHandler (or LogHook) interface with the Logger middleware ?
Why I'm asking this ? Because nowadays if you prefer to use logrus with chi (for example), you have to copy/paste (or fork) the Logger middleware in order to override the printRequest function.

Or, another solution would be to expose a Metrics middleware, which can forward these metrics to a MetricsHandler interface: for exemple, a Logger, a NSQ Producer or a InfluxDB database.

Depending of your preference, I can submit a pull request in the v2 branch.

from chi.

novln avatar novln commented on May 21, 2024 1

@pkieltyka Yeah, you've done a terrific job, as always 😄

from chi.

pkieltyka avatar pkieltyka commented on May 21, 2024

@november-eleven thanks man, that was the goal :)

ahh yes.. the logger interface, I agree this would be a good addition and if you want to take a stab at a prototype+PR, go for it. The simpler the better. I'll add it to the v2 roadmap as well.

from chi.

pkieltyka avatar pkieltyka commented on May 21, 2024

@november-eleven btw, I don't know if you've seen but I added a pretty sweet Logger interface and logging example for structure logging last week.

from chi.

pkieltyka avatar pkieltyka commented on May 21, 2024

https://github.com/pressly/chi/releases/tag/v2.0.0

from chi.

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.