Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable NPlusOneError exceptions when using Profiler? #26

Open
adambyer opened this issue Aug 6, 2018 · 1 comment
Open

Disable NPlusOneError exceptions when using Profiler? #26

adambyer opened this issue Aug 6, 2018 · 1 comment

Comments

@adambyer
Copy link

adambyer commented Aug 6, 2018

Hi. Is there any way to disable the exceptions when using profile.Profiler(), and just get the logs?

@hartwork
Copy link

hartwork commented May 30, 2020

Not raising exceptions would not be hard:

class ForgivingProfiler(Profiler):
    """
    Fork of nplusone.core.profiler.Profiler
    that does not raise exceptions
    """
    def notify(self, message):
        pass  # or collect messages here

If NPLUSONE_RAISE should be respected out of the box, maybe Profiler would need to accept a config paramater. Would it make much difference, to have that built in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants