def error(msg: str, dedupe: bool = False, **kwargs):
    """Print an error message.

    Args:
        msg: The error message.
        dedupe: If True, suppress multiple console logs of error message.
        kwargs: Keyword arguments to pass to the print function.
    """
    if _LOG_LEVEL <= LogLevel.ERROR:
        if dedupe:
            if msg in _EMITTED_ERRORS:
                return
            _EMITTED_ERRORS.add(msg)
        print(f"[red]{msg}[/red]", **kwargs)
    if should_use_log_file_console():
        print_to_log_file(f"[red]{msg}[/red]", **kwargs)
Print an error message.

    Args:
        msg: The error message.
        dedupe: If True, suppress multiple console logs of error message.
        kwargs: Keyword arguments to pass to the print function.
    
reflex/utils/console.py