def pre_process_units()

in elastic_agent_client/service/checkin.py [0:0]


    def pre_process_units(self):
        logger.debug("Pre-processing units")
        if self.client.units is None:
            logger.debug("No units found")
            return

        outputs = [
            unit
            for unit in self.client.units
            if unit.unit_type == proto.UnitType.OUTPUT
        ]

        if len(outputs):
            unit = outputs[0]

            log_level = unit.log_level
            if log_level:
                # Convert the UnitLogLevel to the corresponding Python logging level
                python_log_level = convert_agent_log_level(log_level)
                logger.info(
                    f"Updating log level to {logging.getLevelName(python_log_level)}"
                )
                set_logger(log_level=python_log_level)
            else:
                logger.debug("No log level found for the output unit")
        else:
            logger.info("No outputs found")