class_docstr: JSONFormatter instances are used to convert a log record to json.
code: def format(self, record):
      super().format(record)
      record_dict = {
          label: getattr(record, label, None)
          for label in self.json_fields
      }
      if "message" in self.json_fields:
          msg = record_dict["message"]
          if record.exc_text:
              if msg[-1:] != "\n":
                  msg = msg + "\n"
              msg = msg + record.exc_text
          if record.stack_info:
              if msg[-1:] != "\n":
                  msg = msg + "\n"
              msg = msg + self.formatStack(record.stack_info)
          record_dict["message"] = msg
      merged_record = merge_dicts(record_dict, self.extras)
      return json.dumps(merged_record)
  
file_path: airflow/airflow/utils/log/json_formatter.py
imports: from __future__ import annotations
  import json
  import logging
  from airflow.utils.helpers import merge_dicts
label_desc: Use image node_id 3 for calling the JSONFormatter obj's underlying member method code with example usage: obj.format(record) and returns: json