utils.echo
module utils.echo
utils.echo
class Echo
Echo
Helper class to use when printing output of the CLI.
Provides utilities to print different levels of the messages and provides formatting capabilities to each of the levels.
method __init__
__init__
method debug
debug
Format and echo a debug message
Args:
message
(str): debug message to format and echo
method echo
echo
Main function to print information of a message, original message is provided as well as the formatted one. Original is used when formatting is not possible.
Args:
message
(str): original messageformatted
(str): formatted message
method error
error
Format and echo an error message
Args:
message
(str): error message to format and echo
method format_debug
format_debug
Specific format for debug purposes
Args:
message
(str): message to format
Returns:
str
: debug formatted message
method format_error
format_error
Specific format for error purposes
Args:
message
(str): message to format
Returns:
str
: error formatted message
method format_message
format_message
Format a message with an specific field and color. Adds current time, provided field and prints it with the specified color.
Args:
message
(str): the message to format with the CLIfield
(str): Main field to format with the message. Defaults to "giza".color
(str): Color to format the message with. Defaults to "orange3".
Returns:
str
: the formatted message
method format_warning
format_warning
Specific format for warning purposes
Args:
message
(str): message to format
Returns:
str
: error formatted message
method info
info
Format and echo a message
Args:
message
(str): message to format and echo
method warning
warning
Format and echo a warning message
Args:
message
(str): message to format and echo
Last updated