-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Implementing warnings system and pygame.debug #2944
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: polastyn <78505251+gresm@users.noreply.github.com>
Update outputted warning in docs to reflect changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything in the side of documentation seems fine. Maybe if you add a code example that makes full use of the function argument, it would be more helpful to users.
Hello, thanks for looking at this. This is a complex patch, and I don't really see what adding a pygame-ce specific paradigm of filtering our existing warnings does for us. I did not anticipate pygame.debug changing any existing warnings. It instead would add a whole new category of more opiniated ones and extra information. Maybe it could use SDL_Log and change the SDL log level so we get SDL debug information too? But then again maybe the juice isn't worth the squeeze for this. |
Well, this is a large patch, but it isn't complex - the logic behind it is quite simple, there are just a lot of places that needed to be updated to use the new warnings system (just renaming the Why I'm using what I'm using and not something like SDL warnings which have urgency? Because python warnings system was already used in the code base and I think that benefits that come from using python warnings system outweighs those of SDL warnings system (seamless integration with python code, advanced filtering system supporting regex, unit testing, etc...). An alternative implementation could create multiple filtering rules to ignore given warnings, but it would be slower (warnings that wouldn't be shown, would still need to go through the python warnings system) and harder to maintain (the necessity to keep the filter lists and updating them when a warning is added/removed/changed), so I think this is near optimal solution. That's my opinion on this matters. Note that this PR still needs some finishing touches - |
Fixes #2894
Notes
(mostly to self):pygame.base.get_warnings_filter
/pygame.base.set_warnings_filter
be public API (likely not)?