code: def test_stdout_log(self) -> None:
      logger = StdoutLogger(precision=2)
      with captured_output() as (out, _):
          logger.log(step=0, name="metric_1", data=1.1)
          out = cast(StringIO, out)
          self.assertTrue(
              out.getvalue() == "\n[Step 0] metric_1=1.10",
              msg=repr(f"Actual output: {out.getvalue()}"),
          )
  
          logger.log(step=0, name="metric_2", data=1.2)
          self.assertTrue(
              out.getvalue()
              == "\n[Step 0] metric_1=1.10 metric_2=1.20",
              msg=repr(f"Actual output: {out.getvalue()}"),
          )
  
          logger.log(step=1, name="metric_1", data=2.1)
          self.assertTrue(
              out.getvalue()
              == "\n[Step 0] metric_1=1.10 metric_2=1.20\n[Step 1] metric_1=2.10",
              msg=repr(f"Actual output: {out.getvalue()}"),
          )
  
          logger.close()
          self.assertTrue(
              out.getvalue()
              == "\n[Step 0] metric_1=1.10 metric_2=1.20\n[Step 1] metric_1=2.10\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 1 for calling the StdoutLoggerTest obj's underlying member method code with example usage: obj.test_stdout_log() without return types