code: def test_rankfilter(self):
      logger = logging.getLogger(__name__)
      log_filename = os.path.join(self.log_dir.name, "records.log")
      h1 = logging.FileHandler(filename=log_filename)
      h1.setLevel(logging.WARNING)
  
      logger.addHandler(h1)
  
      logger.addFilter(RankFilter())
      logger.warning("test_warnings")
  
      dist.barrier()
      if dist.get_rank() == 0:
          with open(log_filename) as file:
              lines = [line.rstrip() for line in file]
          log_message = " ".join(lines)
          self.assertEqual(log_message.count("test_warnings"), 1)
  
file_path: MONAI/tests/test_rankfilter_dist.py
imports: from __future__ import annotations
  import logging
  import os
  import tempfile
  import unittest
  import torch.distributed
  from monai.utils import RankFilter
  from tests.utils import DistCall, DistTestCase
label_desc: Use image node_id 2 for calling the DistributedRankFilterTest obj's underlying member method code with example usage: obj.test_rankfilter() without return types