PublicShow sourcedebug.pl -- Print debug messages and test assertions

This library is a replacement for format/3 for printing debug messages. Messages are assigned a topic. By dynamically enabling or disabling topics the user can select desired messages. Debug statements are removed when the code is compiled for optimization.

See manual for details. With XPCE, you can use the call below to start a graphical monitoring tool.

?- prolog_ide(debug_monitor).

Using the predicate assertion/1 you can make assumptions about your program explicit, trapping the debugger if the condition does not hold.

author
- Jan Wielemaker
Source debugging(+Topic) is semidet
debugging(-Topic) is nondet
Source debugging(?Topic, ?Bool) is nondet
Examine debug topics. The form debugging(+Topic) may be used to perform more complex debugging tasks. A typical usage skeleton is:
      (   debugging(mytopic)
      ->  <perform debugging actions>
      ;   true
      ),
      ...

The other two calls are intended to examine existing and enabled debugging tokens and are typically not used in user programs.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Source debug(Arg1, Arg2, Arg3)
Source list_debug_topics
Source debug_message_context(Arg1)
Source assertion(Arg1)
Source nodebug(Arg1)
Source debug(Arg1)