def format_log(epoch, iteration, errors, t):
    """
    Generic format for print/log.

    :param epoch: epoch.
    :type epoch: int
    :param iteration: iteration.
    :type iteration: int
    :param errors: errors dictionary.
    :type errors: dict[float]
    :param t: time.
    :type t: float
    :return: message.
    :rtype: str
    """
    message = '(epoch: %d, iteration: %d, time: %.3f) ' % (epoch, iteration, t)
    for k, v in errors.items():
        message += '%s: %.3f ' % (k, v)
    return message