-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Add debug/logging macro(s) for togglable debug output in the Godot source #7095
Comments
IMO this is a must have for 3.1, it's starting to be hard to manage. We now have a nice logging interface, it's time to make proper use of it. |
A proper logging system would definitely be very helpful for engine development. I think, though, that more in-depth discussion about the scope and intended use case is required. Is it going to be a tool that will be solely used by the engine developers for debugging and thus should adhere to the "the simpler, the better" philosophy? Or is it going to be a more robust tool with more functionality that could be used by the engine developers, but would also be exposed to GDScript to be used as a flexible logging utility for the game devs as well? I personally think that a proper logging system would be helpful for game dev as well and thus it should be implemented for GDScript, sooner or later. However, maybe there is a good reason why the engine logging system should be more lightweight and thus separate from the more generic game logging system? Please, share your thoughts! |
What's the difference between this and the verbose printing we currently have. |
I am not entirely sure what you are referring to by this? Do you mean the lightweight engine-only version?
Well, @akien-mga himself said about the
In case you refer to the more generic version:
Well, I can see multiple additions that the game devs would appreciate and some have already been mentioned in other issues and gathered in the #19122 tracker issue. These include: Coloured output, folding/grouping same messages together, verbosity levels and filtering based on them, logging to file, ... Some of these would also be beneficial for the engine development as well, but not necessary. Or is there something else you had in mind? |
I was asking what would be the difference between Regarding different verbosity levels, that would be definitely welcome. |
Oh, that... Well, I guess that was just an example?? And the idea is that the current logging system should be reworked? But that's just my understanding of it. Maybe @akien-mga can explain what he had in mind. |
This was partly obsolete by the Yet I'd want to see the whole system refactored in a cleaner interface with different verbosity levels, and well documented guidelines on what to use and where. The log messages should be integrated in the It should be not done to be exposed to GDScript, that would force overengineering something to make it configurable for all possible use cases, instead of focusing on what engine devs need. |
I also see a benefit in implementing a proper log system with good guidelines on how to use it. And I also see your point in why you'd prefer having the system separate from GDScript - and I partially agree. On the other hand, the reason why I suggested this in the first place is that I'd see a benefit in implementing this kind of system for GDScript too. So, would you prefer developing two separate systems, one for the engine devs and one for GDScript? What I had in mind is implementing the system for GDScript - you described it right, probably overengineered and configurable for all possible use cases - and then exposing the necessary functionality needed for the engine devs via macros. Still, the priority would be developing the system for the engine first. Hence, the system would not be exposed to GDScript immediately. First, the necessary functionality would be implemented for the engine dev and the full functionality would be implemented later. |
Hello Mr . akien-mga |
Closing, as this has been addressed on the engine side with the introduction of |
Follow-up on #7079 (comment)
Currently we have lots of
print_line
andprintf
calls in the source code, that are either active (and often noisy) or commented out.It would be better to have a macro like
DEBUG_PRINT
for those debugging statements, that would only output the string passed as an argument when in debug mode (triggered by the-d
,-debug
command line arguments).It might be worth discussing if we want several levels of verbosity too.
The text was updated successfully, but these errors were encountered: