@Brian_Wilson , thanks.
I deveop custom widgets on WAB and now I start moving to EXB (both Developer Edition), and the web apps are used by many users thrughout the country. I work on JS (not Python).
I developed up to now one "web service" that have a log of each call and also have errlog. I also inserted in its code that every some hours it runs on pre designed "fake input" and logs accordingly.
My main work are web apps that are run only interactively by users. I can not test them by "run test".
I am already using url optional parameters to log debug info to console in key points. This is used only by me when developing or testing.
What I take from you is the additional idea of inserting "traps" in the code to check the program while it is running the regular way by the users. I'll sum up:
1. I'll implant "console.assert" in key points in code to "trap" when things are not ok. This will be effective mainly when I run the web app, because users regularly do not examine the console.
2. In order to "trap" and log errors when users are running the web app, I think that "assert" is not effective, so I'll do:
2.1. Pay attention to log all "try-catch" failures (and user command failures) to some DB (I already have such DB) to be examined by me and by the customer service from time to time.
2.2. Insert "If" blocks in key points, to "trap" unexpected behaviors log them to same DB mentioned above.
2.3 Maybe I'll use my assert function either to log to DB or throw error (which will be logged to DB). The advantage of this is that I can search for all "assert" in my code, to examine wher I do the checks.
const assert = function(condition, message) {
if (!condition)
throw Error('Assert failed: ' + (message || ''));
};