There is a need for a better log solution for the PSM. The current one is just a simplistic message printer, essentially without any logic for saving to file, supressing repetitive messages, selectable time stamp source, etc. There are quite a few open source libraries that may be a good approach for integration. Also, it turns out that there may be a case for the PSM to be able to generate exceptions. Not as a generic solution for error handling, but as a mean of integrate expected error generation with the testing framework (Catch 2). Catch can catch (hep) exceptions but critical erros such as SIGABRT is not as easy to catch and test by the testing framework. Exceptions as such shall however NOT be elevated to the PIM.
One log-library candidate is https://github.com/SergiusTheBest/plog
Exceptions, callbacks, SIG*** are all asynchronous, or of-sequence execution paths. I.e. they break the expected instruction sequence defined by a procedure (i.e. a program). The fundamental computer architecture execution is based on history-preserving procedures. That is the reason we have a stack, a.k.a. a LIFO-queue. Exceptions et al, are not preserving history, but are history agnostic and asynchronous. The PIM already has a solidly defined support for that - The event driven state machiens, which is the same as a FIFO-queue. Thus, if the underlaying PSM need to generate an exception, this shall be converted to an event in the PIM.
Diff: