Did you know ... | Search Documentation: |
Predicate debug/1 |
nodebug(_)
removes
all topics. Gives a warning if the topic is not defined unless it is
used from a directive. The latter allows placing debug topics at the
start of a (load-)file without warnings.
For debug/1, Topic
can be a term Topic > Out
, where Out is
either a stream or stream-alias or a filename (an atom). This redirects
debug information on this topic to the given output. On Linux systems
redirection can be used to make the message appear, even if the user_error
stream is redefined using
?- debug(Topic > '/proc/self/fd/2').
A platform independent way to get debug messages in the current
console (for example, a swipl-win
window, or login using ssh
to Prolog running an SSH server from the libssh
pack) is to
use:
?- stream_property(S, alias(user_error)), debug(Topic > S).
Do not forget to disable the debugging using nodebug/1 before quitting the console if Prolog must remain running.
it's not totally clear from the docs how to remove unwanted "no matching debug topic (yet)" messages. The docs say a warning is emitted (a) if the topic is "defined" and (b) it is not used from a directive.
There isn't really any instruction on how to "define" topics, other than via debug/1... which prints the warning!
It seems the preferred way to do this is to declare the topics as directives using nodebug/1
:- nodebug(topic1). :- nodebug(topic2). ...