The techniques presented here relieve developers of the need to design and implement their own tracing strategies, allowing them to concentrate on their application's main logic. The tracing techniques presented here are just a few of many tracing strategies available to the application developer. For example, exceptions, though not an output trace mechanism in themselves, are a programming construct for execution flow and error flow processing, or tracing, within application code. An output trace mechanism such as one of the techniques presented here could be combined with the exception handling strategy one chooses within application code. In fact, source code samples presented here show the insertion of trace statements in exception handling code.
Assertions are another programming construct useful in application code for error detection.
The exact behavior and functionality of assertions depend on the language or package that implements the assertion function. If the assertion fails, the program is generally terminated. An assertion strategy can again be combined together with an output trace mechanism such as one of the techniques presented here. The assertion API and its function are implementation dependent. Neither the Java language nor JDK currently provide built-in assertion capabilities.