import traceback


def formatTraceback(err):
    """
    Format a traceback for an error so that it can go into logs.

    Args:
        err (BaseException): The error the traceback is extracted from.

    Returns:
        str: The __str__() of the error, followed by the standard formatting
            of the traceback on the following lines.
    """
    return "".join(traceback.format_exception(None, err, err.__traceback__))