from datetime import datetime


def parse_line(line):
    """
    Extract all the data we want from each line.

    :param line: A line from our log files.
    :return: The data we have extracted.
    """

    time = line.split()[0].strip()
    response = line.split(' :')
    message = response[len(response) - 1].strip('\n')
    channel = response[1].split('#')
    username = channel[0].split('!')
    username = username[0]
    channel = channel[1]
    time = datetime.strptime(time, '%Y-%m-%d_%H:%M:%S')

    return time, channel, username, message