Printing status and error messages

Author(s): The CLIP Group.

This is a very simple library for printing status and error messages to the console.

Documentation on exports

PREDICATE

Usage: error_message(Text)

  • Description: Same as message(error,Text).
  • The following properties should hold at call time:
    (basic_props:string/1)Text is a string (a list of character codes).

PREDICATE

Meta-predicate with arguments: error_message(?,addmodule(?)).

Usage: error_message(Text,ArgList)

  • Description: Same as message(error,Text,ArgList).
  • The following properties should hold at call time:
    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

PREDICATE

Meta-predicate with arguments: error_message(?,?,addmodule(?)).

Usage: error_message(Lc,Text,ArgList)

  • Description: Same as message(error,Lc,Text,ArgList).
  • The following properties should hold at call time:
    (c_itf_internal:location_t/1)Identifies a source line range in a file.
    location_t(loc(File,L1,L2)) :-
            atm(File),
            int(L1),
            int(L2).
    

    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

PREDICATE

Usage: warning_message(Text)

  • Description: Same as message(warning,Text).
  • The following properties should hold at call time:
    (basic_props:string/1)Text is a string (a list of character codes).

PREDICATE

Meta-predicate with arguments: warning_message(?,addmodule(?)).

Usage: warning_message(Text,ArgList)

  • Description: Same as message(warning,Text,ArgList).
  • The following properties should hold at call time:
    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

PREDICATE

Meta-predicate with arguments: warning_message(?,?,addmodule(?)).

Usage: warning_message(Lc,Text,ArgList)

  • Description: Same as message(warning,Lc,Text,ArgList).
  • The following properties should hold at call time:
    (c_itf_internal:location_t/1)Identifies a source line range in a file.
    location_t(loc(File,L1,L2)) :-
            atm(File),
            int(L1),
            int(L2).
    

    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

PREDICATE

Usage: note_message(Text)

  • Description: Same as message(note,Text).
  • The following properties should hold at call time:
    (basic_props:string/1)Text is a string (a list of character codes).

PREDICATE

Meta-predicate with arguments: note_message(?,addmodule(?)).

Usage: note_message(Text,ArgList)

  • Description: Same as message(note,Text,ArgList).
  • The following properties should hold at call time:
    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

PREDICATE

Meta-predicate with arguments: note_message(?,?,addmodule(?)).

Usage: note_message(Lc,Text,ArgList)

  • Description: Same as message(note,Lc,Text,ArgList).
  • The following properties should hold at call time:
    (c_itf_internal:location_t/1)Identifies a source line range in a file.
    location_t(loc(File,L1,L2)) :-
            atm(File),
            int(L1),
            int(L2).
    

    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

PREDICATE

Usage: simple_message(Text)

  • Description: The text provided in Text is printed.
  • The following properties should hold at call time:
    (basic_props:string/1)Text is a string (a list of character codes).

PREDICATE

Usage: simple_message(Text,ArgList)

  • Description: The text provided in Text is printed as a message, using the arguments in ArgList.
  • The following properties should hold at call time:
    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

PREDICATE

Usage: optional_message(Text,Opts)

  • Description: The text provided in Text is printed as a message, but only if the atom -v is a member of Opts. These predicates are meant to be used for optional messages, which are only to be printed when verbose output is requested explicitly.
  • The following properties should hold at call time:
    (basic_props:string/1)Text is a string (a list of character codes).
    (basic_props:list/2)Opts is a list of atms.

PREDICATE

Usage: optional_message(Text,ArgList,Opts)

  • Description: The text provided in Text is printed as a message, using the arguments in ArgList, but only if the atom -v is a member of Opts. These predicates are meant to be used for optional messages, which are only to be printed when verbose output is requested explicitly.
  • The following properties should hold at call time:
    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.
    (basic_props:list/2)Opts is a list of atms.

PREDICATE

Usage: debug_message(Text)

  • Description: The text provided in Text is printed as a debugging message. These messages are turned on by defining a fact of issue_debug_messages/1 with the module name as argument.
  • The following properties should hold at call time:
    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.

PREDICATE

Meta-predicate with arguments: debug_message(?,addmodule(?)).

Usage: debug_message(Text,ArgList)

  • Description: The text provided in Text is printed as a debugging message, using the arguments in ArgList to interpret any variable-related formatting commands embedded in Text. These messages are turned on by defining a fact of issue_debug_messages/1 which the module name as argument.
  • The following properties should hold at call time:
    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

PREDICATE

Usage: debug_goal(Goal,Text)

  • Description: Goal is called. The text provided in Text is then printed as a debugging message. The whole process (including running Goal) is turned on by defining a fact of issue_debug_messages/1 with the module name as argument.

PREDICATE

Meta-predicate with arguments: debug_goal(goal,?,addmodule(?)).

Usage: debug_goal(Goal,Text,ArgList)

  • Description: Goal is called. The text provided in Text is then printed as a debugging message, using the arguments in ArgList to interpret any variable-related formatting commands embedded in Text. Note that the variables in ArgList can be computed by Goal. The whole process (including running Goal) is turned on by defining a fact of issue_debug_messages/1 with the module name as argument.

PREDICATE

Usage: show_message(Type,Text)

  • Description: The text provided in Text is printed as a message of type Type.
  • The following properties should hold at call time:
    (messages:message_t/1)The types of messaes supported by the message predicate
    (basic_props:string/1)Text is a string (a list of character codes).

PREDICATE

Meta-predicate with arguments: show_message(?,?,addmodule(?)).

Usage: show_message(Type,Text,ArgList)

  • Description: The text provided in Text is printed as a message of type Type, using the arguments in ArgList to interpret any variable-related formatting commands embedded in Text.
  • The following properties should hold at call time:
    (messages:message_t/1)The types of messaes supported by the message predicate
    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

PREDICATE

Meta-predicate with arguments: show_message(?,?,?,addmodule(?)).

Usage: show_message(Type,Lc,Text,ArgList)

  • Description: The text provided in Text is printed as a message of type Type, using the arguments in ArgList to interpret any variable-related formatting commands embedded in Text, and reporting error location Lc (file and line numbers).
  • The following properties should hold at call time:
    (messages:message_t/1)The types of messaes supported by the message predicate
    (c_itf_internal:location_t/1)Identifies a source line range in a file.
    location_t(loc(File,L1,L2)) :-
            atm(File),
            int(L1),
            int(L2).
    

    (format:format_control/1)Text is an atom or string describing how the arguments should be formatted. If it is an atom it will be converted into a string with name/2.
    (basic_props:list/1)ArgList is a list.

REGTYPE

Usage:

  • Description: The types of messaes supported by the message predicate

(UNDOC_REEXPORT)
location_t/1:
Imported from c_itf_internal (see the corresponding documentation for details).

Documentation on multifiles

PREDICATE

The predicate is multifile.
The predicate is of type data.

Usage: issue_debug_messages(Module)

  • Description: Printing of debugging messages is enabled for module Module.
  • The following properties hold upon exit:
    (basic_props:atm/1)Module is an atom.

Known bugs and planned improvements

  • Debug message switching should really be done with an expansion, for performance.