docstr: Check if the given hook is allowed to log.
docstr_tok: ["Check","if","the","given","hook","is","allowed","to","log","."]
code: 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/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`."
          )
  
file_path: pytorch-lightning/src/lightning/pytorch/trainer/connectors/logger_connector/fx_validator.py
imports: from typing import Optional, Tuple, Union
  from typing_extensions import TypedDict
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
label_desc: Use image node_id 1 for calling the _FxValidator obj's underlying member method code with example usage: obj.check_logging(cls, fx_name) without return types