-
Notifications
You must be signed in to change notification settings - Fork 99
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
Make log.exception the default but with a way to silence it #158
Comments
or to continue with #151 and remove it alltogether. i would be happy if it was removed. so far the only place logging is used in core is in
|
WilliamStam
changed the title
make log.exception the default but with a way to silence it
Make log.exception the default but with a way to silence it
Jun 15, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
EDIT: See the comment bellow. I think removing the logging altogether is the way to go. Its only being used in 1 place.
It would be pretty cool if there was a way to "silence" the log exception in the library. For instance if the app logs all exceptions to DB / log file / external system then having the library
log.exception(f"aio process {os.getpid()} failed")
results in a double log with a ton of "aio process failed" ones which arent as useful if you are trying to handle the exceptions appropriately.I propose that the library get a flag that can be set to
log_exception
which by default isTrue
(backwards compatibility) and if false then it wontlog.exception(f"aio process {os.getpid()} failed")
it will simply raise the error like normalthe pool worker has an exception handler but the Worker doesn't altho im not sure if that matters much to this suggestion.
test case
Expectation: to not log the
aio process 11092 failed
exception. to only have theTestException
and not bothFix: let the developer set a flag to
log_exception
to False for it to simply notlog.exception
it.workaround: setting a custom logging handler that ignores log messages that match "aio process xxxx failed" which im sure is a really bad idea.
The text was updated successfully, but these errors were encountered: