from datetime import datetime


def log(message, when=None):
    """
    Log a message with a timestamp.
    :param message: Message to print.
    :param when: datetime of when the message occured.
                 Defaults to the present time.
    :return:
    """
    when = datetime.now() if when is None else when
    print('{0}: {1}'.format(when, message))

    return True