def stdout_step_format(step) -> str:
    """Create strp logging string for stdout.

    Args:
        step (list): a list, like [epoch, iteration, iterations]

    Returns:
        str: String prepared for logging to stdout.
             Example: `epoch    1 | iter  81/312`
    """ 
    
    if isinstance(step, str):
        return step
    fields = []
    if len(step) > 0:
        fields.append("epoch {:>4}".format(step[0]))
    if len(step) > 1:
        fields.append("iter {:>3}".format(step[1]))
    if len(step) > 2:
        fields[-1] += "/{}".format(step[2])
    return " | ".join(fields)