A.14 library(debug): Print debug messages and test assertions
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(debug): Print debug messages and test assertions
          • debugging/1
          • debugging/2
          • debug/1
          • nodebug/1
          • list_debug_topics/0
          • debug_message_context/1
          • debug/3
          • debug_print_hook/3
          • assertion/1
          • assertion_failed/2
    • Packages
Availability::- use_module(library(debug)).(can be autoloaded)
Source[det]debug(+Topic, +Format, :Args)
Format a message if debug topic is enabled. Similar to format/3 to user_error, but only prints if Topic is activated through debug/1. Args is a meta-argument to deal with goal for the @-command. Output is first handed to the hook prolog:debug_print_hook/3. If this fails, Format+Args is translated to text using the message-translation (see print_message/2) for the term debug(Format, Args) and then printed to every matching destination (controlled by debug/1) using print_message_lines/3.

The message is preceded by’% ’and terminated with a newline.

See also
format/3.