Printing status and error messages

Author(s): The Ciao Development Team.

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

Documentation on exports

Usage:show_message(Type,Text)

The text provided in Text is printed as a message of type Type.

Usage:show_message(Type,Text,ArgList)

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 messages 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.
Meta-predicate with arguments: show_message(?,?,addmodule(?)).

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

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 messages supported by the message predicate.
    (c_itf: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.
Meta-predicate with arguments: show_message(?,?,?,addmodule(?)).

This type defines the types of messages supported by the message priting predicates.
message_t(error).
message_t(warning).
message_t(note).
message_t(simple).
message_t(debug).

Usage:

The types of messages supported by the message predicate.

    Usage:error_message(Text)

    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).

    Usage:error_message(Text,ArgList)

    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.
    Meta-predicate with arguments: error_message(?,addmodule(?)).

    Usage:error_message(Lc,Text,ArgList)

    Same as message(error,Lc,Text,ArgList).

    • The following properties should hold at call time:
      (c_itf: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.
    Meta-predicate with arguments: error_message(?,?,addmodule(?)).

    Usage:warning_message(Text)

    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).

    Usage:warning_message(Text,ArgList)

    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.
    Meta-predicate with arguments: warning_message(?,addmodule(?)).

    Usage:warning_message(Lc,Text,ArgList)

    Same as message(warning,Lc,Text,ArgList).

    • The following properties should hold at call time:
      (c_itf: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.
    Meta-predicate with arguments: warning_message(?,?,addmodule(?)).

    Usage:note_message(Text)

    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).

    Usage:note_message(Text,ArgList)

    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.
    Meta-predicate with arguments: note_message(?,addmodule(?)).

    Usage:note_message(Lc,Text,ArgList)

    Same as message(note,Lc,Text,ArgList).

    • The following properties should hold at call time:
      (c_itf: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.
    Meta-predicate with arguments: note_message(?,?,addmodule(?)).

    Usage:simple_message(Text)

    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).

    Usage:simple_message(Text,ArgList)

    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.

    Usage:optional_message(Text,Opts)

    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.

    Usage:optional_message(Text,ArgList,Opts)

    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.

    Usage:debug_message(Text)

    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.

    Usage:debug_message(Text,ArgList)

    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.
    Meta-predicate with arguments: debug_message(?,addmodule(?)).

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

    Documentation on multifiles

    Usage:issue_debug_messages(Module)

    Printing of debugging messages is enabled for module Module.

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

    Documentation on imports

    This module has the following direct dependencies:

    Known bugs and planned improvements

    • Debug message switching should really be done with an expansion, for performance (see other debug/trace packages).