import shutil
import textwrap


def format_message(msg, msg_type):
    """Format a message in function of message type and terminal's size.

    Args:
        msg (str): Message to format.
        msg_type (Log): Kind of message.

    Returns:
        str: Return formatted message.

    """
    term_size = shutil.get_terminal_size()
    return textwrap.fill(
        msg, width=term_size.columns, initial_indent="",
        subsequent_indent=" " * len(msg_type.value)
    )