Aussie AI
Advanced Debug Tracing
-
Book Excerpt from "Generative AI in C++"
-
by David Spuler, Ph.D.
Advanced Debug Tracing
The above ideas are far from being the end of the options for debug tracing. The finesses to using debug tracing messages include:
- Environment variable to enable debug messages.
- Command-line argument to enable them (and set the level).
- Configuration settings (eg. changeable inside the GUI, or in a config file).
- Add unit tests running in trace mode (because sometimes debug tracing crashes!).
- Extend to multiple sets or named classes of debug messages, not just numeric levels, so you can trace different aspects of execution dynamically.
Supportability Tip: Think about customers and debug tracing messages: are there times when you want users to enable them? Usually, the answer is yes. Whenever a user has submitted an error report, you'd like the user to submit a run of the program with tracing enabled to help with reproducibility. Hence, consider what you want to tell customers about enabling tracing (if anything). Similarly, debug tracing messages could be useful to phone support staff in various ways to diagnose or resolve customer problems. Consider how a phone support person might help a customer to enable these messages.
• Next: • Up: Table of Contents |
The new AI programming book by Aussie AI co-founders:
Get your copy from Amazon: Generative AI in C++ |