def logger(self) -> Optional[Union[Logger, FabricLogger]]:
        """Reference to the logger object in the Trainer."""
        if self._fabric is not None:
            return self._fabric.logger
        return self._trainer.logger if self._trainer is not None else None
Reference to the logger object in the Trainer.
src/lightning/pytorch/core/module.py