This library provides an structured alternative for putting print-statements into your source-code to trace what is going on. Debug messages are organised in topics that can be activated and de-activated without changing the source. In addition, if the application is compiled with the -O flag these predicates are removed using goal_expansion/2.
Although this library can be used through the normal demand-loading mechanism it is adviced to load it explicitely before code using it to profit from goal-expansion, which removes these calls if compiled with optimisation on and records the topics from debug/3 and debugging/1 for list_debug_topics/0.
informational
.
Format and Args are interpreted by format/2.
Here is a typical example:
..., debug(init, 'Initialised ~w', [Module]), ...,
Topic can be any Prolog term. Compound terms can be used to make categories of topics that can be activated using debug/1.
If Goal fails the system prints a message, followed by a stack-trace and starts the debugger.
In older versions of this library this predicate was called assume/1 . Code using assume/1 is automatically converted while printing a warning on the first occurrence.