code: def get_log_legacy(
      self,
      ds_type,
      location,
      logtype,
      attempt,
      flow_name,
      run_id,
      step_name,
      task_id,
  ):
      ds_cls = self._get_datastore_storage_impl(ds_type)
      ds_root = ds_cls.path_join(*ds_cls.path_split(location)[:-5])
      cache_id = self._flow_ds_id(ds_type, ds_root, flow_name)
  
      token = (
          "%s.cached"
          % sha1(
              os.path.join(
                  run_id, step_name, task_id, "%s_log" % logtype
              ).encode("utf-8")
          ).hexdigest()
      )
      path = os.path.join(self._cache_dir, cache_id, token[:2], token)
  
      cached_log = self.read_file(path)
      if cached_log is not None:
          return cached_log
  
      ds = self._get_flow_datastore(ds_type, ds_root, flow_name)
  
      task_ds = ds.get_task_datastore(
          run_id,
          step_name,
          task_id,
          data_metadata={"objects": {}, "info": {}},
      )
  
      log = task_ds.load_log_legacy(logtype, attempt_override=attempt)
      # Store this in the file cache as well
      self.create_file(path, log)
      return log
  
imports: from __future__ import print_function
  from collections import OrderedDict
  import os
  import sys
  import time
  from tempfile import NamedTemporaryFile
  from hashlib import sha1
  from metaflow.datastore import FlowDataStore
  from metaflow.datastore.content_addressed_store import BlobCache
  from metaflow.exception import MetaflowException
  from metaflow.metaflow_config import CLIENT_CACHE_PATH, CLIENT_CACHE_MAX_SIZE, CLIENT_CACHE_MAX_FLOWDATASTORE_COUNT, CLIENT_CACHE_MAX_TASKDATASTORE_COUNT
  from metaflow.plugins import DATASTORES
label_desc: Use image node_id 4 for calling the FileCache obj's underlying member method code with example usage: obj.get_log_legacy(ds_type, location, logtype, attempt, flow_name, run_id, step_name, task_id) and returns: log, cached_log