class_docstr: CloudwatchTaskHandler is a python log handler that handles and reads task instance logs.
  
  It extends airflow FileTaskHandler and uploads to and reads from Cloudwatch.
  
  :param base_log_folder: base folder to store logs locally
  :param log_group_arn: ARN of the Cloudwatch log group for remote log storage
      with format ``arn:aws:logs:{region name}:{account id}:log-group:{group name}``
  :param filename_template: template for file name (local storage) or log stream name (remote)
code: def _event_to_str(self, event: dict) -> str:
      event_dt = datetime.utcfromtimestamp(event["timestamp"] / 1000.0)
      formatted_event_dt = event_dt.strftime("%Y-%m-%d %H:%M:%S,%f")[
          :-3
      ]
      message = event["message"]
      return f"[{formatted_event_dt}] {message}"
  
imports: from __future__ import annotations
  from datetime import date, datetime, timedelta
  from functools import cached_property
  from typing import TYPE_CHECKING, Any
  import watchtower
  from airflow.configuration import conf
  from airflow.providers.amazon.aws.hooks.logs import AwsLogsHook
  from airflow.providers.amazon.aws.utils import datetime_to_epoch_utc_ms
  from airflow.utils.log.file_task_handler import FileTaskHandler
  from airflow.utils.log.logging_mixin import LoggingMixin
label_desc: Use image node_id 8 for calling the CloudwatchTaskHandler obj's underlying member method code with example usage: obj._event_to_str(event) and returns: str, formatted_event_dt, str, message