class_docstr: Class for sending messages to task instance logs from outside task execution context.
  
  This is intended to be used mainly in exceptional circumstances, to give visibility into
  events related to task execution when otherwise there would be none.
  
  :meta private:
class_docstr_tok: ["Class","for","sending","messages","to","task","instance","logs","from","outside","task","execution","context",".","This","is","intended","to","be","used","mainly","in","exceptional","circumstances",",","to","give","visibility","into","events","related","to","task","execution","when","otherwise","there","would","be","none",".",":","meta","private",":"]
docstr: Initialize the task context logger with the component name.
  
  :param component_name: the name of the component that will be used to identify the log messages
  :param call_site_logger: if provided, message will also be emitted through this logger
docstr_tok: ["Initialize","the","task","context","logger","with","the","component","name",".",":","param","component_name",":","the","name","of","the","component","that","will","be","used","to","identify","the","log","messages",":","param","call_site_logger",":","if","provided",",","message","will","also","be","emitted","through","this","logger"]
code: def __init__(
      self, component_name: str, call_site_logger: Logger | None = None
  ):
      """
      Initialize the task context logger with the component name.
  
      :param component_name: the name of the component that will be used to identify the log messages
      :param call_site_logger: if provided, message will also be emitted through this logger
      """
      self.component_name = component_name
      self.task_handler = self._get_task_handler()
      self.enabled = self._should_enable()
      self.call_site_logger = call_site_logger
  
file_path: airflow/airflow/utils/log/task_context_logger.py
imports: from __future__ import annotations
  import logging
  from contextlib import suppress
  from copy import copy
  from logging import Logger
  from typing import TYPE_CHECKING
  from airflow.configuration import conf
label_desc: Use image node_id 1 to create a new TaskContextLogger object  with example: obj = TaskContextLogger(component_name, call_site_logger)