| Did you know ... | Search Documentation: |
| Predicate message_hook/3 |
message_hook(+Term,
+Kind, +Lines)user to
intercept messages from print_message/2. Term
and Kind are the same as passed to print_message/2. Lines
is a list of format statements as described with print_message_lines/3.
See also
message_to_string/2.
If calling this hook succeeds, the message is considered printed and no further action is taken. Version 9.3.34 introduced prolog:message_action/2 to allow modules to act on certain actions. Before prolog:message_action/2 was introduced a program could associate an action with a message by adding a clause for message_hook/3 that realises the desired action and then fails. The problem with this approach for actions is that the order of clauses for a multi-file predicate is poorly defined. If the application defines a hook that succeeds, this hook may cause intended actions not to take place.
This predicate must be defined dynamic and multifile to allow other modules defining clauses for it too.