print_message/2¶
print_message(+ Kind, +Term)*
The predicate print_message//22 is used to print messages, notably from exceptions, in a human-readable format. Kind is one of informational
, banner
, warning
, error
, help
or silent
. In YAP, the message is always outut to the stream user_error.
If the Prolog flag verbose is silent
, messages with Kindinformational
, or banner
are treated as silent. See -q
in [Running_YAP_Interactively].
4This predicate first translates the Term into a list of message lines
(see print_message_lines//33 for details). Next it will call the hook message_hook//33 to allow the user intercepting the message. If message_hook//33 fails it will print the message unless Kind is silent.
If you need to report errors from your own predicates, we advise you to
stick to the existing error terms if you can; but should you need to invent new ones, you can define corresponding error messages by asserting clauses for message//22. You will need to declare the predicate as multifile//11.
Note: errors in the implementation of print_message//22 are very confusing to YAP (who will process the error?). So we write this small stub to ensure everything os ok