def check_logging(cls, fx_name: str) -> None:
        """Check if the given hook is allowed to log."""
        if fx_name not in cls.functions:
            raise RuntimeError(
                f"Logging inside `{fx_name}` is not implemented."
                " Please, open an issue in `https://github.com/Lightning-AI/pytorch-lightning/issues`."
            )

        if cls.functions[fx_name] is None:
            raise MisconfigurationException(
                f"You can't `self.log()` inside `{fx_name}`. HINT: You can still log directly to the logger by using"
                " `self.logger.experiment`."
            )
Check if the given hook is allowed to log.
src/lightning/pytorch/trainer/connectors/logger_connector/fx_validator.py