def safe_logging() -> Logger:
    """
    Update the handlers and loggers to make the logging safe.  Store
    the private data local and update the log message with a link to this data.

    :return: A safe version of the task logger.

    - Create a SafeHandler that logs the private data to local storage.
    - Updates the message to include the uri to the private data.  The message needs to
        be updated as the CloudHandler doesn't actually call a formatter.
    - Insert the SafeHandler at the beginning of the handler list for the prefect logger.
        This is a bit of hack as it mutates the message when it is called so that it
        has the uri in it for the other existing handlers.
    """
    safe_handler = SafeFileHandler()
    safe_formatter = Formatter(prefect.config.logging.format)
    safe_handler.setFormatter(safe_formatter)
    prefect_logger = prefect.utilities.logging.get_logger()
    prefect_logger.handlers.insert(0, safe_handler)
    return prefect.context.get("logger")
	