Next: mpg-ref-meta_predicate, Previous: mpg-ref-memberchk, Up: mpg-bpr [Contents][Index]
message_hook/3
hook:- multifile user:message_hook/3.
user:message_hook(+Severity, +MessageTerm, +Lines)
Overrides the call to print_message_lines/3
in print_message/2
.
A way for the user to intercept the Message of type
Severity, whose translations is Lines, before it is
actually printed.
one of [informational,warning,error,help,silent]
term
list of list of pair
Is of the form [Line1, Line2, …]
, where each
Linei is of the form
[Control_1-Args_1,Control_2-Args_2, …]
.
After a message is parsed, but before the message is
written, print_message/2
calls
user:message_hook(+Severity,+MsgTerm,+Lines)
If the call to user:message_hook/3
succeeds, then print_message/2
succeeds without further processing. Otherwise the built-in message
portrayal is used. It is often useful to have a message hook that
performs some action and then fails, allowing other message hooks to
run, and eventually allowing the message to be printed as usual.
An exception raised by this predicate causes an error message to be printed and then the original message is printed using the default message text and formatting.