Optionally Hide Debug Output (Finished Games Only)

Reporter: time-killer-games  |  Status: open  |  Last Modified: September 19, 2020, 10:33:40 PM

It would be desirable to hide all debug output the engine does internally to give the user complete control of what gets printed and what doesn't.

Intended for complete games. Should never be used otherwise so bugs can be debugged.

HIDDEN_DEBUG_OUTPUT needs to be defined by a checkbox in LateralGM/RadialGM and a flag in emake for these changes to even be usable.

codecov[bot]  
>Codecov Report

Merging #2138 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2138   +/-   ##
=======================================
  Coverage   32.97%   32.97%           
=======================================
  Files         197      197           
  Lines       19051    19051           
=======================================
  Hits         6283     6283           
  Misses      12768    12768           
Impacted Files Coverage Δ
...GMAsystem/SHELL/Widget_Systems/widgets_mandatory.h 50.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b37591...3565950. Read the comment docs.

fundies  

I would instead change the implementations in the widget systems. Users may want to turn these messages on and off at certain points too. We could also allow this to be more granular. I added message types for user_error, user_warning and etc but you could even add more so users could disable/hide all sprite lookup failures or all errors from a certain object type or whatever.

std::map<message_type, bool> printErrs;
set_debug_output_enabled(bool enabled, message_type) {
  printErrs[message_type] = enabled;
}

void show_debug_message(string message, message_type) {
  if (!printErrs[message_type]) return;
  ...
} 

time-killer-games  

@fundies that's a good idea. @JoshDreamland ignore my message and please don't merge this, i didn't see fundies review until just now

@fundies I have a particular way I'm going to go about doing this and let me know what you think next time i ping you will be when its ready.

time-killer-games  

@fundies i'd still like to have a checkbox for the ide and flag for emake so this couldd be overriden for an entire project simply by the click of a mouse and no code editing. But there you have it, we have your functions in here as well

I'd be happy to add these things myself but i only intend to do it with rgm and emake and won't until i need it.

fundies  

@fundies i'd still like to have a checkbox for the ide and flag for emake so this could be overridden for an entire project simply by the click of a mouse and no code editing. But there you have it, we have your functions in here as well

I'd be happy to add these things myself but i only intend to do it with rgm and emake and won't until i need it.

Adding check boxes to ides and etc is a pain. Even though I wouldn't consider this an extension you could create one that enables this for you using a static intializer. I do this in the freetype extension. See FontManager class for an example.

time-killer-games  

My initial thought was to make it an extension but I wasnt sure if you guys would like that idea and not merge it I added it.
fundies  

My initial thought was to make it an extension but I wasnt sure if you guys would like that idea and not merge it I added it.

We'll the code I mentioned should only be a few lines. The rest should be in universal. I do not think it should permanently live there but I think it is really your only option aside from hacking up the compiler. I think we need a better mechanism for conditional contemplation of various settings but for now this all we got.

Please sign in to post comments, or you can view this issue on GitHub.