def group_timelogs(timelogs, logf):
    """ Group multiple timelogs with same ticket, description and date """
    cache = {}
    for timelog in timelogs:
        key = "{}:{}:{}".format(
            timelog.ticket, timelog.description, timelog.date.date()
        )
        logf(
            "Found worklog {}: {} ({}) ({})".format(
                timelog.ticket, timelog.description, timelog.date, timelog.time
            )
        )
        if key not in cache:
            cache[key] = timelog
        else:
            cache[key].time += timelog.time

    logf("\n---\n")
    for timelog in cache.values():
        logf(
            "Grouped worklog {}: {} ({}) ({})".format(
                timelog.ticket, timelog.description, timelog.date, timelog.time
            )
        )

    return cache.values()