def format_title(msg: str) -> str:
    """Function to format a message title for logging
        Parameters
        ----------
        msg : str
            string to print to log
        Returns
        ----------
        result : str
            formatted log message
    """

    max_msg_len = 120
    assert len(msg) <= 120, "max message length for a title is {}".format(max_msg_len)
    buffer_len = 10
    ln_len = len(msg) + (buffer_len * 2) + 2

    ln = ln_len * "#"
    buffer = buffer_len * " "
    result = """
    {ln}
    #{buffer}{msg}{buffer}#
    {ln}
    """.format(
        ln=ln, buffer=buffer, msg=msg
    )

    return result