def METHOD_NAME(self, line):
    if RE_LOG_START.match(line):
        if RE_TASK_RECEIVED.match(line):
            task_name, task_id = task_info(line)
            self.task_received(line, task_name, task_id)
        elif RE_TASK_READY.match(line):
            task_name, task_id = task_info(line)
            result = RE_TASK_RESULT.match(line)
            if result:
                result, = result.groups()
            self.task_ready(line, task_name, task_id, result)
        else:
            if self.on_debug:
                self.on_debug(line)
        self.prev_line = line
    else:
        if self.on_trace:
            self.on_trace('\n'.join(filter(None, [self.prev_line, line])))
        self.prev_line = None