Printmessage¶
flowtask.components.PrintMessage
¶
PrintMessage
¶
Bases: FlowComponent
PrintMessage
Overview
This component prints a formatted message to the console with optional coloring and logging.
.. table:: Properties
:widths: auto
+-------------+----------+-----------+-------------------------------------------------------+
| Name | Required | Summary |
+-------------+----------+-----------+-------------------------------------------------------+
| message | Yes | The message to print, with optional variable substitution. |
+-------------+----------+-----------+-------------------------------------------------------+
| color | No | The color to use for the message. Overrides the level-based color.|
+-------------+----------+-----------+-------------------------------------------------------+
| level | No | The log level of the message ("INFO", "DEBUG", "WARN", "ERROR", |
| | | "CRITICAL"). Default is "INFO". |
+-------------+----------+-----------+-------------------------------------------------------+
| condition | No | A condition to evaluate before printing the message. The message |
| | | is printed only if the condition is True. |
+-------------+----------+-----------+-------------------------------------------------------+
| first | Yes | First message |
+-------------+----------+-----------+-------------------------------------------------------+
| last | Yes | Last message |
+-------------+----------+-----------+-------------------------------------------------------+
Returns
This component returns the printed message.
Example:
```yaml
PrintMessage:
message: 'End Form Metadata: {orgid}/{formid}'
color: green
level: WARN
```