zaimoni / Cataclysm

A post-apocalyptic roguelike. New features relative to C:Whales are scheduled for after 0.2.0, the savefile breaking release.
http://www.bay12forums.com/smf/index.php?topic=174897
Other
26 stars 3 forks source link

Debugging harness #63

Open zaimoni opened 4 years ago

zaimoni commented 4 years ago

This needs significant buildout/rethinking.

What is currently present is:

Context:

I Zaimoni am fine with evaluating relevant third-party libraries for use, whose licenses are compatible with the Creative Commons license inherited from C:Whales. I Am Not A Lawyer; my understanding is that fully permissive licenses (such as Boost or MIT) are compatible, while copyleft licenses (such as the GPL) are incompatible. (There is a gap in the project documentation; the GitHub hosted wiki needs updating.)

Points intended to be precise enough to be contradictable:

"We" (referring to all currently active developers) immediately could use:

** The assert re-implementation should also leave a trace here in debug builds, when not intentionally landing in the debugger.

** The debugging log should not spam the user interface (this could cause file loading to freeze when debugging file format changes); thus, extending debugmsg is not sufficient for this purpose (and it is reasonable that many current debugmsg calls should be changed to this new silent mode).

** It would be reasonable, to hook debugmsg calls into this debugging log.

** There should be some indication in the game that the debugging log has triggered, but it should not itself interfere with gameplay. This indication may depend on how the game is built.

** the current debugmsg calls would be fine when interrupting gameplay is reasonable.

zaimoni commented 4 years ago

Many current usages of the legacy debugmsg function will have to be adjusted as well. Generally speaking (this is a restatement and/or amplification of points of initial summary):

One of the more popular third-party C++ libraries is https://github.com/gabime/spdlog (MIT license)

zaimoni commented 4 years ago

spdlog dependency: https://github.com/fmtlib/fmt . License "weak MIT" (should just be Boost).

zaimoni commented 4 years ago

I don't think we need the hard-to-replicate features of spdlog at this time. (Unusual logging destinations: Windows or *NIX system error logging.) It should suffice to create the error log on first use.

zaimoni commented 4 years ago

Further buildout of this is stalling (most remaining changes have to do with call invariants which ideally would be compile-time errors, but most of those have been caught).

It is unfortunate that C++ contracts was half-baked and had to be removed. (The proposal as voted in initially, was not that useful -- it was "advisory" rather than enabling hard syntax errors.)