class_docstr: Logger that prints metrics to stdout on rank 0. Each step is logged on a different line.
  Metrics belonging to the same step will be printed in the order they were logged on
  the same line. Step number is treated as an opaque identifier, successive steps do
  not have to be consecutive, but it is generally good practice to make them so.
  
  Args:
      precision (int): The number of digits to print after the decimal point. The default value is
      set to 4. The output will be rounded per the usual rounding rules.
  
  Example:
      from torchtnt.utils.loggers import StdoutLogger
  
      logger = StdoutLogger()
      logger.log(step=1, name="accuracy", data=0.982378)
      logger.log(step=1, name="loss", data=0.23112)
      logger.log_dict(step=2, payload={"accuracy": 0.99123, "loss": 0.18787})
  
      This will print the following to stdout in order:
      [Step 1] accuracy=0.9824, loss=0.2311
      [Step 2] accuracy=0.9912, loss=0.1879
class_docstr_tok: ["Logger","that","prints","metrics","to","stdout","on","rank","0",".","Each","step","is","logged","on","a","different","line",".","Metrics","belonging","to","the","same","step","will","be","printed","in","the","order","they","were","logged","on","the","same","line",".","Step","number","is","treated","as","an","opaque","identifier",",","successive","steps","do","not","have","to","be","consecutive",",","but","it","is","generally","good","practice","to","make","them","so",".","Args",":","precision","(","int",")",":","The","number","of","digits","to","print","after","the","decimal","point",".","The","default","value","is","set","to","4",".","The","output","will","be","rounded","per","the","usual","rounding","rules",".","Example",":","from","torchtnt.utils.loggers","import","StdoutLogger","logger","=","StdoutLogger","(",")","logger.log","(","step=1",",","name=","''","accuracy","''",",","data=0.982378",")","logger.log","(","step=1",",","name=","''","loss","''",",","data=0.23112",")","logger.log_dict","(","step=2",",","payload=","{","``","accuracy","''",":","0.99123",",","``","loss","''",":","0.18787","}",")","This","will","print","the","following","to","stdout","in","order",":","[","Step","1","]","accuracy=0.9824",",","loss=0.2311","[","Step","2","]","accuracy=0.9912",",","loss=0.1879"]
code: def log(self, name: str, data: Scalar, step: int) -> None:
      self._start_new_step_if_needed(step)
      self._log_metric(name, data)
  
file_path: tnt/torchtnt/utils/loggers/stdout.py
imports: import atexit
  import logging
  import sys
  from typing import Mapping, Optional
  from torchtnt.utils.distributed import rank_zero_fn
  from torchtnt.utils.loggers.logger import MetricLogger, Scalar
  from torchtnt.utils.loggers.utils import scalar_to_float
label_desc: Use image node_id 4 for calling the StdoutLogger obj's underlying member method code with example usage: obj.log(name, data, step) without return types