simplify logTasks function