class_docstr: Task log reader.
class_docstr_tok: ["Task","log","reader","."]
docstr: Read chunks of Task Instance logs.
  
  :param ti: The taskInstance
  :param try_number: If provided, logs for the given try will be returned.
      Otherwise, logs from all attempts are returned.
  :param metadata: A dictionary containing information about how to read the task log
  
  The following is an example of how to use this method to read log:
  
  .. code-block:: python
  
      logs, metadata = task_log_reader.read_log_chunks(ti, try_number, metadata)
      logs = logs[0] if try_number is not None else logs
  
  where task_log_reader is an instance of TaskLogReader. The metadata will always
  contain information about the task log which can enable you read logs to the
  end.
docstr_tok: ["Read","chunks","of","Task","Instance","logs",".",":","param","ti",":","The","taskInstance",":","param","try_number",":","If","provided",",","logs","for","the","given","try","will","be","returned",".","Otherwise",",","logs","from","all","attempts","are","returned",".",":","param","metadata",":","A","dictionary","containing","information","about","how","to","read","the","task","log","The","following","is","an","example","of","how","to","use","this","method","to","read","log",":","..","code-block",":",":","python","logs",",","metadata","=","task_log_reader.read_log_chunks","(","ti",",","try_number",",","metadata",")","logs","=","logs","[","0","]","if","try_number","is","not","None","else","logs","where","task_log_reader","is","an","instance","of","TaskLogReader",".","The","metadata","will","always","contain","information","about","the","task","log","which","can","enable","you","read","logs","to","the","end","."]
code: def read_log_chunks(
      self, ti: TaskInstance, try_number: int | None, metadata
  ) -> tuple[list[tuple[tuple[str, str]]], dict[str, str]]:
      """
      Read chunks of Task Instance logs.
  
      :param ti: The taskInstance
      :param try_number: If provided, logs for the given try will be returned.
          Otherwise, logs from all attempts are returned.
      :param metadata: A dictionary containing information about how to read the task log
  
      The following is an example of how to use this method to read log:
  
      .. code-block:: python
  
          logs, metadata = task_log_reader.read_log_chunks(ti, try_number, metadata)
          logs = logs[0] if try_number is not None else logs
  
      where task_log_reader is an instance of TaskLogReader. The metadata will always
      contain information about the task log which can enable you read logs to the
      end.
      """
      logs, metadatas = self.log_handler.read(
          ti, try_number, metadata=metadata
      )
      metadata = metadatas[0]
      return logs, metadata
  
file_path: airflow/airflow/utils/log/log_reader.py
imports: from __future__ import annotations
  import logging
  import time
  from functools import cached_property
  from typing import TYPE_CHECKING, Iterator
  from airflow.configuration import conf
  from airflow.utils.helpers import render_log_filename
  from airflow.utils.log.logging_mixin import ExternalLoggingMixin
  from airflow.utils.session import NEW_SESSION, provide_session
  from airflow.utils.state import TaskInstanceState
label_desc: Use image node_id 1 for calling the TaskLogReader obj's underlying member method code with example usage: obj.read_log_chunks(ti, try_number, metadata) and returns: logs,  metadata