GithubHelp home page GithubHelp logo

Comments (5)

holm avatar holm commented on July 30, 2024

I was just looking to solve the same problem. It would be nice to be able to separate these concerns.

from nestjs-sentry.

doctorrokter avatar doctorrokter commented on July 30, 2024

@holm for now I have a temp workaround in my project:

  • manually edited source code in /node_modules and simply disabled super.log, super.error etc calls inside SentryService.
  • created a patch using npx patch-package @ntegral/nestjs-sentry
  • added a post-install hook into package.json file which will run patch every time.

Definetely worth a try to fork the repo, get rid of inheritance and do a PR.

Rather than extending ConsoleLogger class would be better to implement LoggerService interface instead. In that case we still will have NestJS-like logging API.
And in addition we could provide custom logger class (or instance) during SentryModule initialization to let SentryService write custom logs if we want.

from nestjs-sentry.

doctorrokter avatar doctorrokter commented on July 30, 2024

@ntegral @holm created PR for that FR, hope it looking not bad:

#54

from nestjs-sentry.

holm avatar holm commented on July 30, 2024

Awesome. Thanks for doing that. Added a few comments on the PR, just from my perspective, although of course this is not my library at all :)

from nestjs-sentry.

foxted avatar foxted commented on July 30, 2024

Looks like by using the instance directly, it doesn't log into the console. So using: this.sentry.instance().captureMessage() instead of this.sentry.log().

from nestjs-sentry.

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.