-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
searching for a print #3884
Comments
That could be helpful. +1 |
do better prints :) |
👍 - Plus, it doesn't seem too hard to do |
@akien-mga ~ You can tag this with "enhancement"/"feature proposal" + "topic:gdscript" + "junior job" + (only if you think it needs it) "discussion" |
Is anybody assigned this task? Can I try to do it? |
@fumgames ~ I'm not going to find time anytime soon, and I guess @nunodonato and @freemanfromgodotengine haven't started with it either... so, just go! |
I hadn't the minor intention of doing it... I'm sorry but it sounds like a bad feature that will just motivate people to do bad debugs. I can't find any positive things about it |
@nunodonato ~ I think that this might be rather helpful for some game developers, plus, it doesn't bloat the engine even a bit. |
@bojidar-bg if you can type myprintfunc("whatever") you can also print("line 20"). seems unnecessary bloat when you should be learning how to properly debug your code. I just can't find a good enough reason to support this "feature", but whatever :) |
@nunodonato ~ I look at it the other way -- there aren't many reasons not too add it 😄 |
@bojidar-bg that's true.. but if you use that criteria all the time, you end up with a bloated project with stuff that is useful in some remote cases. "Perfection is not when there is nothing else to add, but when there is nothing left to take away" ;) |
@nunodonato ~ uh, that's true too... but having to do formatting stuff each time is boring... |
On a big projects with many lines you can't expect someone to remember each print, specially when you work in a team. Searching for a print or change the print line number each time you change the code is big waste of time. |
The main interest I would see in such a feature is if you want to actually output relevant debug info in logs for your players, so that they can report to you where your game did not behave correctly. Might also be useful for the team directly if it's a debug option (btw having prints everywhere that you don't need is IMO pointless, but if they are triggered by a "debug=true" option, then it becomes interesting to see how the calls are made from one file/line to the other). So for me such a function would be mostly useful in:
Though of course, as I write it, I realise that it wouldn't work as it would likely print the line where this helper function is defined XD |
@akien-mga what's the problem in implementing function "print_debug" which will work only if debug is active?) I mean, you shouldn't define your own "print_debug", just use the internal |
:D , I also thought about the debug flag. Maybe we could later do a plugin where you have a list of all prints and can say I don't want to see the debug informations of Node X or line X so you don't have to use (un)comments all the time... I think printd is still free maybe it is better than printl |
Yeah, I guess being able to disable this kind of prints via project settings would be awesome. |
How about implementing a default argument "debug" or the function print, which would print the line numbers and other details only if the debug argument is set to True? For instance, |
@AdityaCheruvu |
Yeah, you can use |
I think I am not the only one who is using print for debugging but at some point you have so many "print" and don't know where they are coming from so maybe this could be implemented.
Output:
"something happened - path/to/script.gd line 42"
The text was updated successfully, but these errors were encountered: