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

feat: Added ability to print globals as part of debug messages #561

Merged
merged 2 commits into from
Apr 5, 2022

Conversation

balloonpopper
Copy link
Collaborator

@balloonpopper balloonpopper commented Apr 3, 2022

This allows debug messages to print the contents of globals. Globals are indicated by brace symbols " { } "

debug "r3_button_broken is currently {r3_button_broken}"

I have added the function to resolve globals to all debug levels (info, warning etc) but due to bug 219 I can't test other debug levels so I'm not sure if the behavior is correct.

If everyone's happy with the "{ global }" notation, I'll need to update the documentation in the documentation repo.

The alternative is Godot string notation

debug "Name %s is %d years old", name, age

But I don't know how to extend the parser to cope with this so I went with what I knew how to code :D

Output for valid global

2022-4-3T11331 (D)	Running command debug with parameters [r3_button_broken is currently True] 	
2022-4-3T11331 (D)	debug command issued 	[r3_button_broken is currently {r3_button_broken}]

Invalid global :

2022-4-3T105254 (D)	Running command debug with parameters [r3_button_broken is currently Null] 	
2022-4-3T105254 (D)	debug command issued 	[r3_button_broken is currently {invalid_global}]

Fixes godot-escoria/escoria-issues#205

@balloonpopper balloonpopper changed the title WIP: Added ability to print globals as part of debug messages feat: Added ability to print globals as part of debug messages Apr 3, 2022
@balloonpopper balloonpopper force-pushed the debug_globals branch 2 times, most recently from 730a24d to 3601964 Compare April 3, 2022 04:20
@StraToN StraToN merged commit aa6a4c4 into godot-escoria:develop Apr 5, 2022
@StraToN
Copy link
Collaborator

StraToN commented Apr 5, 2022

Thanks!

@balloonpopper balloonpopper deleted the debug_globals branch April 15, 2022 01:17
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

Successfully merging this pull request may close these issues.

debug command to support outputting the contents of globals and states
3 participants