def METHOD_NAME(
    self,
    extra: Optional[Dict],
    num_updates: int,
    max_updates: int,
    log_type: str = "train",
):
    logger.info(f"{num_updates}/{max_updates}")
    if extra is not None:
        logger.info(", ".join([f"{key}: {value}" for key, value in extra.items()]))
    scalar_dict = self.lightning_trainer.torchmetrics.get_scalar_dict()
    scalar_dict_with_type = {f"{log_type}_{k}": v for k, v in scalar_dict.items()}
    if self.lightning_trainer.tb_writer is not None:
        self.lightning_trainer.tb_writer.add_scalars(
            scalar_dict_with_type, num_updates
        )
    logger.info(f"{log_type} metrics:")
    logger.info(
        ", ".join([f"{key}: {value}" for key, value in scalar_dict.items()])
    )