(
    text: str, icon: str, log_fn: Callable, fg: str, indent: str = ""
)
Print operational messages to stderr with styling.
    Comes with preconfigured functions for common styles:
    `echo_error`, `echo_warning`, and `echo_success`


    :param text: Text to print, will be wrapped line-by-line.
    :param icon: An icon, emoji or otherwise, to prefix the first line with.
    :param log_fn: A function to call with the raw text.
                   Meant to write to log files in the appropriate format.
    :param fg: A click-compatible color name to use as text color.
    :param indent: A string to prepend to every line, such as "  " or "... "

    >>> echo_error("ERROR\nTask failed successfully.", indent="  ")
      ✘ ERROR
      Task failed successfully.
Print operational messages to stderr with styling.
    Comes with preconfigured functions for common styles:
    `echo_error`, `echo_warning`, and `echo_success`
Print operational messages to stderr with styling . Comes with preconfigured functions for common styles : echo_error echo_warning and echo_success
def echo_styled(
    text: str, icon: str, log_fn: Callable, fg: str, indent: str = ""
) -> None:
    """
    Print operational messages to stderr with styling.
    Comes with preconfigured functions for common styles:
    `echo_error`, `echo_warning`, and `echo_success`


    :param text: Text to print, will be wrapped line-by-line.
    :param icon: An icon, emoji or otherwise, to prefix the first line with.
    :param log_fn: A function to call with the raw text.
                   Meant to write to log files in the appropriate format.
    :param fg: A click-compatible color name to use as text color.
    :param indent: A string to prepend to every line, such as "  " or "... "

    >>> echo_error("ERROR\nTask failed successfully.", indent="  ")
      ✘ ERROR
      Task failed successfully.
    """
    log_fn(text)
    prefix = f"{icon} "
    lines = text.splitlines()
    for line in lines:
        secho(wrap(f"{indent}{prefix}{line}"), fg=fg, err=True)
        prefix = ""
def echo_styled ( text : str , icon : str , log_fn : Callable , fg : str , indent : str = "" ) -> None : log_fn ( text ) prefix = f"{icon} " lines = text . splitlines ( ) for line in lines : secho ( wrap ( f"{indent}{prefix}{line}" ) , fg = fg , err = True ) prefix = ""