docstr: Check if the given hook name is allowed to log and return logging levels.
docstr_tok: ["Check","if","the","given","hook","name","is","allowed","to","log","and","return","logging","levels","."]
code: def check_logging_and_get_default_levels(
      cls,
      fx_name: str,
      on_step: Optional[bool],
      on_epoch: Optional[bool],
  ) -> Tuple[bool, bool]:
      """Check if the given hook name is allowed to log and return logging levels."""
      cls.check_logging(fx_name)
      on_step, on_epoch = cls.get_default_logging_levels(
          fx_name, on_step, on_epoch
      )
      cls.check_logging_levels(fx_name, on_step, on_epoch)
      return on_step, on_epoch
  
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 4 for calling the _FxValidator obj's underlying member method code with example usage: obj.check_logging_and_get_default_levels(cls, fx_name, on_step, on_epoch) and returns: on_step,  on_epoch