def log_output_artifact()

in src/smexperiments/tracker.py [0:0]


    def log_output_artifact(self, file_path, name=None, media_type=None):
        """Upload a local file to s3 and store it as an output artifact in this trial component.

        Examples
            .. code-block:: python

                # log local artifact
                my_tracker.log_output_artifact(file_path='/local/path/artifact.tar.gz')

        Args:
            file_path (str): The path of the local file to upload.
            name (str, optional): The name of the artifact.
            media_type (str, optional): The MediaType (MIME type) of the file. If not specified, this library
                will attempt to infer the media type from the file extension of ``file_path``.
        """
        if len(self.trial_component.output_artifacts) >= 30:
            raise ValueError("Cannot add more than 30 output_artifacts under tracker trial_component")
        media_type = media_type or _guess_media_type(file_path)
        name = name or _resolve_artifact_name(file_path)
        s3_uri, etag = self._artifact_uploader.upload_artifact(file_path)
        self.trial_component.output_artifacts[name] = api_types.TrialComponentArtifact(
            value=s3_uri, media_type=media_type
        )
        self._lineage_artifact_tracker.add_output_artifact(name, s3_uri, etag, media_type)