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)

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

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

PREDICATE

Usage:error_message(Lc,Text,ArgList)

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

PREDICATE

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

PREDICATE

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

PREDICATE

Usage:warning_message(Lc,Text,ArgList)

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

PREDICATE

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

PREDICATE

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

PREDICATE

Usage:note_message(Lc,Text,ArgList)

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

PREDICATE

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

PREDICATE

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.

PREDICATE

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.

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

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)

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

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

PREDICATE

Usage:debug_goal(Goal,Text)

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

    Usage:debug_goal(Goal,Text,ArgList)

    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.

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

      PREDICATE

      Usage:show_message(Type,Text)

      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

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

      PREDICATE

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

      REGTYPE

      Usage:

      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

        (Trust) Usage:issue_debug_messages(Module)

        Printing of debugging messages is enabled for module Module.

        • The following properties hold upon exit:
          (basic_props:atm/1)Module is an atom.
        The predicate is multifile.
        The predicate is of type data.

        Known bugs and planned improvements

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