4.11.4 Printing messages
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Built-in Predicates
        • Exception handling
          • Printing messages
            • print_message/2
            • print_message_lines/3
            • message_hook/3
            • thread_message_hook/3
            • message_property/2
            • message_line_element/2
            • message_prefix_hook/2
            • message_to_string/2
            • version/0
            • version/1
            • Printing from libraries
    • Packages
message_property(+Kind, ?Property)
This hook can be used to define additional message kinds and the way they are displayed. The following properties are defined:
color(-Attributes)
Print message using ANSI terminal attributes. See ansi_format/3 for details. Here is an example, printing help messages in blue:
:- multifile user:message_property/2.

user:message_property(help, color([fg(blue)])).
prefix(-Prefix)
Prefix printed before each line. This argument is handed to format/3. The default is '~N'. For example, messages of kind warning use '~NWarning: '.
location_prefix(+Location, -FirstPrefix, -ContinuePrefix)
Used for printing messages that are related to a source location. Currently, Location is a term File:Line. FirstPrefix is the prefix for the first line and -ContinuePrefix is the prefix for continuation lines. For example, the default for errors is
location_prefix(File:Line,
                '~NERROR: ~w:~d:'-[File,Line], '~N\t')).
stream(-Stream)
Stream to which to print the message. Default is user_error.
wait(-Seconds)
Amount of time to wait after printing the message. Default is not to wait.