Improve error reporting and general output #2694
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This does a few things to try and improve game output and error reporting. Almost certainly not the last word, but its surely a step in the right direction.
OS::Warning
andOS::Error
moved toutils.cpp
, renamedWarning
andError
, and reimplemented to use SDL_ShowSimpleMessageBox. It looks like this:Win32 (via Wine):
Linux:
Output also goes to the output channel for easy copying. The nice thing about this is that it doesn't require that we have any screen stuff, GL context, anything set up. So we always have a way to tell the user what happened.
Error()
, sinceabort()
causes an ugly runtime exception on Windows.printf(...)
andfprintf(stderr, ...)
replaced by a functionOutput()
. Currently it just throws stuff on stderr (or to the logfile if enabled). This way there's no odd mix of output tostdout
orstderr
, and we can do other things later (like all output to in-game console)RedirectStdio
is enabled (as it is by default on Window), output now goes to a singleoutput.txt
instead of the oldstdout.txt
andstderr.txt
. Again, easier for problem reporting.Gui::Screen::ShowBadError
andGui::MainLoopIteration
are gone. No more redscreen!