[Ohrrpgce] SVN: teeemcee/10727 Add debugerror, showbug, fatalbug functions and rearrange ErrorLevelEnum

Ralph Versteegen teeemcee at gmail.com
Sun Sep 30 05:06:10 PDT 2018


(Part 1: just talking to myself)

Our error reporting is quite a mess, and I certainly made it far messier
when I added different error levels.
This commit is just an exercise in hill-climbing: making a small
improvement without thinking about the global optimum: whether the whole
thing should actually be replaced.
I'm pretty sick of telling people to look in g/c_debug.txt when they have a
problem - it's not just for us; those error messages are often useful for
people too.
We usually just call debug to log an error. There are about 750 calls to
debug which aren't commented out. Some are just debug noise, some are
errors, some indicate corrupt data, some are engine bugs, some are fatal
errors.
I hope that by adding (in particular) showbug and debugerror that these
will get used more instead of debug.

I guess we don't want to pop up error messages unnecessarily while you're
playing a game, just like we don't want to show script errors, if there's a
possibility that the error can just be ignored.
I also don't like how showerror prompts the user to quit the program (once
3 errors have occurred), because you don't want to do that while editing a
game unless you're really stuck.

(Part 2: some ideas)

So maybe a certain severity of error (I guess that's debugerror; debug is
used too much) should be logged if it happens in-game, but pops up a
message if it happens while editing (or in Test Game)?
But then there's a still a risk of it turning into spamming.

So, instead, maybe what we should do is that when debugerror is called, we
display a warning icon in the corner of the screen for a few seconds with
some text like "F9 to see error", and in Custom's F9 menu is an option "See
error log" (probably excluding debuginfo).
Such an option in the F9 menu would be great either way.
The warning icon could be shown in-game too, because a lot of errors
indicate data that couldn't be loaded and you'd likely want to know that as
a player. If it just displays for a few seconds it doesn't interrupt the
game a fraction as badly as calling showerror.

Also, I'd like to use CrashRpt to report whenever a bug is detected. Can
send a minidump/stacktrace. We can do that on Linux/Mac too, just need
extra code to upload to the server.


On Mon, 1 Oct 2018 at 00:39, <subversion at hamsterrepublic.com> wrote:

> teeemcee
> 2018-09-30 04:39:04 -0700 (Sun, 30 Sep 2018)
> 543
> Add debugerror, showbug, fatalbug functions and rearrange ErrorLevelEnum
> levels
>
> There are now aliases for most debugc error levels:
>  debuginfo
>  debug
>  visible_debug
>  debugerror
>  showerror
>  showbug
>  fatalerror
>  fatalbug
> So I will mostly stop using debugc.
>
> Got rid of errShowError, renamed errShow to errShowError and errFatal to
> errFatalError, added errShowInfo and errShowDebug (the latter is
> visible_debug). Simplified visible_debug and dist_info.
>
> Also, forgot to update errorlevel.h and C/C++ code after renaming
> ErrorLevelEnum
> constants.
> ---
> U   wip/allmodex.bas
> U   wip/array.c
> U   wip/common.rbas
> U   wip/common_base.bas
> U   wip/common_base.bi
> U   wip/const.bi
> U   wip/distribmenu.bas
> U   wip/errorlevel.h
> U   wip/filelayer.cpp
> U   wip/gfx_sdl2.bas
> U   wip/misc.h
> U   wip/surface.cpp
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20181001/b8ea3158/attachment-0001.html>


More information about the Ohrrpgce mailing list