def handle_closed_task(self, task_name, record):
if task_name not in self.tasks:<EOL><INDENT>return<EOL><DEDENT>if self.main_failed:<EOL><INDENT>self.mark_parent_tasks_as_failed(self.cur_task)<EOL><DEDENT>if self.tasks[task_name].failed:<EOL><INDENT>record.msg = ColorFormatter.colored('<STR_LIT>', END_TASK_ON_ERROR_MSG)<EOL><DEDENT>else:<EOL><INDENT>record.msg = ColorFormatter.colored('<STR_LIT>', END_TASK_MSG)<EOL><DEDENT>record.msg += '<STR_LIT>' % self.tasks[task_name].elapsed_time()<EOL>if self.should_show_by_depth() or self.tasks[task_name].force_show:<EOL><INDENT>if self.tasks[task_name].force_show:<EOL><INDENT>self.handle_error()<EOL><DEDENT>self.pretty_emit(record, is_header=True)<EOL><DEDENT>self.close_children_tasks(task_name)<EOL>self.tasks.pop(task_name)<EOL>
Do everything needed when a task is closed

Params:
    task_name (str): name of the task that is finishing
    record (logging.LogRecord): log record with all the info

Returns:
    None