def __log_tmetry_keys()

in iopath/common/file_io.py [0:0]


    def __log_tmetry_keys(self, handler: PathHandler, kvs: Dict[str, VTYPE]) -> None:
        """
        Logs a dictionary of key-value pairs to a given path handler.

        Args:
            handler (PathHandler): The path handler to send the key-value pairs to.
            kvs (Dict): Dict of Key-value pairs to be logged.

        """
        if self._enable_logging:
            handler.add_keys(kvs)
            handler.add_key("handler", type(handler).__name__)
            try:
                handler.log_event()
            except Exception:
                logger = logging.getLogger(__name__)
                logger.exception(
                    "An exception occurred in telemetry logging."
                    "Disabling telemetry to prevent further exceptions."
                )
                self._enable_logging = False