code: def test_stdout_log_dict(self) -> None:
      logger = StdoutLogger(precision=0)
      with captured_output() as (out, _):
          logger.log_dict(
              step=0, payload={"metric_1": 1, "metric_2": 1}
          )
          out = cast(StringIO, out)
          self.assertTrue(
              out.getvalue() == "\n[Step 0] metric_1=1 metric_2=1",
              msg=repr(f"Actual output: {out.getvalue()}"),
          )
  
          logger.log_dict(step=0, payload={"metric_3": 1})
          self.assertTrue(
              out.getvalue()
              == "\n[Step 0] metric_1=1 metric_2=1 metric_3=1",
              msg=repr(f"Actual output: {out.getvalue()}"),
          )
  
          logger.log_dict(
              step=1,
              payload={
                  "metric_1": 2,
                  "metric_2": 2.2,
                  "metric_3": 2.2344,
              },
          )
          self.assertTrue(
              out.getvalue()
              == "\n[Step 0] metric_1=1 metric_2=1 metric_3=1\n[Step 1] metric_1=2 metric_2=2 metric_3=2",
              msg=repr(f"Actual output: {out.getvalue()}"),
          )
  
          logger.close()
          self.assertTrue(
              out.getvalue()
              == "\n[Step 0] metric_1=1 metric_2=1 metric_3=1\n[Step 1] metric_1=2 metric_2=2 metric_3=2\n\n",
              msg=repr(f"Actual output: {out.getvalue()}"),
          )
  
file_path: tnt/tests/utils/loggers/test_stdout.py
imports: import unittest
  from io import StringIO
  from typing import cast
  from torchtnt.utils.loggers.stdout import StdoutLogger
  from torchtnt.utils.test_utils import captured_output
label_desc: Use image node_id 2 for calling the StdoutLoggerTest obj's underlying member method code with example usage: obj.test_stdout_log_dict() without return types