print_message/3 — Logtalk 3.100.1

built-in method

# `print_message/3`

## Description

    print_message(Kind, Component, Term)

Built-in method for printing a message represented by a term, which is converted to the message text using the logtalk::message_tokens(Term, Component) hook non-terminal. This method is declared in the logtalk built-in object as a public predicate. The line prefix and the output stream used for each `Kind-Component` pair can be found using the logtalk::message_prefix_stream(Kind, Component, Prefix, Stream) hook predicate.

This predicate starts by converting the message term to a list of tokens and by calling the logtalk::message_hook(Message, Kind, Component, Tokens) hook predicate. If this predicate succeeds, the `print_message/3` predicate assumes that the message has been successfully printed.

By default: messages of kind `debug` or `debug(_)` are only printed when the `debug` flag is turned on; messages of kind `banner`, `comment`, or `comment(_)` are only printed when the `report` flag is set to `on`; messages of kind `warning` and `warning(_)` are not printed when the `report` flag is set to `off`; messages of kind `silent` and `silent()` are not printed (but can be intercepted).

## Modes and number of proofs

    print_message(+nonvar, +nonvar, +nonvar) - one

## Errors

(none)

## Examples

    ..., logtalk::print_message(information, core, redefining_entity(object, foo)), ...

See also

message_hook/4, message_prefix_stream/4, message_tokens//2, print_message_tokens/3, print_message_token/4, ask_question/5, question_hook/6, question_prompt_stream/4