def record(self, ekey, entry, diff=False):
        """Records the specified entry to the key-value store under the specified
        entity key.

        Args:
            ekey (str): fqdn/uuid of the method/object to store the entry for.
            entry (dict): attributes and values gleaned from the execution.
            diff (bool): when True, the "c" element of `entry` will be diffed
              against previous entries under the same `ekey` if their method
              (attribute "m") matches.
        """
        if ekey not in self.entities:
            self.entities[ekey] = []
            
        #See if we need to diff the code to compress it.
        if diff and len(self.entities[ekey]) > 0:
            #Compress the code element of the current entry that we are saving.
            from acorn.logging.diff import cascade, compress
            sequence = [e["c"] for e in self.entities[ekey]
                        if e["m"] == entry["m"]]
            original = cascade(sequence)
            difference = compress(original, entry["c"])
            #Now, overwrite the entry with the compressed version.
            entry["c"] = difference

        self.entities[ekey].append(entry)

        #We also need to make sure we have uuids and origin information stored
        #for any uuids present in the parameter string.
        from uuid import UUID
        uid = None
        if entry["r"] is not None:
            uid = entry["r"]
        elif isinstance(ekey, str):
            #For many methods we don't duplicate the UUID in the returns part
            #because it wastes space. In those cases, the ekey is a UUID.
            try:
                uid = str(UUID(ekey))
            except ValueError: # pragma: no cover
                pass

        if uid is not None and isinstance(uid, str):
            self.log_uuid(uid)

        #For the markdown and function definitions, we don't have any arguments,
        #so we set that to None to save space.
        if entry["a"] is None:
            return
                    
        for larg in entry["a"]["_"]:
            #We use the constructor to determine if the format of the argument
            #is a valid UUID; if it isn't then we catch the error and keep
            #going.
            if not isinstance(larg, str):
                continue
            
            try:
                uid = str(UUID(larg))
                self.log_uuid(uid)
            except ValueError:
                #This was obviously not a UUID, we don't need to worry about it,
                #it has a user-readable string instead.
                pass

        #We also need to handle the keyword arguments; these are keyed by name.
        for key, karg in entry["a"].items():
            if key == "_" or not isinstance(karg, str):
                #Skip the positional arguments since we already handled them.
                continue
            try:
                uid = str(UUID(karg))
                self.log_uuid(uid)
            except ValueError:
                pass