class_docstr: Logger for Ray Datasets which writes logs to a separate log file
  at `DatasetLogger.DEFAULT_DATASET_LOG_PATH`. Can optionally turn off
  logging to stdout to reduce clutter (but always logs to the aformentioned
  Datasets-specific log file).
  
  After initialization, always use the `get_logger()` method to correctly
  set whether to log to stdout. Example usage:
  ```
  logger = DatasetLogger(__name__)
  logger.get_logger().info("This logs to file and stdout")
  logger.get_logger(log_to_stdout=False).info("This logs to file only)
  logger.get_logger().warning("Can call the usual Logger methods")
  ```
docstr: Returns the underlying Logger, with the `propagate` attribute set
  to the same value as `log_to_stdout`. For example, when
  `log_to_stdout = False`, we do not want the `DatasetLogger` to
  propagate up to the base Logger which writes to stdout.
  
  This is a workaround needed due to the DatasetLogger wrapper object
  not having access to the log caller's scope in Python <3.8.
  In the future, with Python 3.8 support, we can use the `stacklevel` arg,
  which allows the logger to fetch the correct calling file/line and
  also removes the need for this getter method:
  `logger.info(msg="Hello world", stacklevel=2)`
docstr_tok: ["Returns","the","underlying","Logger",",","with","the","`","propagate","`","attribute","set","to","the","same","value","as","`","log_to_stdout","`",".","For","example",",","when","`","log_to_stdout","=","False","`",",","we","do","not","want","the","`","DatasetLogger","`","to","propagate","up","to","the","base","Logger","which","writes","to","stdout",".","This","is","a","workaround","needed","due","to","the","DatasetLogger","wrapper","object","not","having","access","to","the","log","caller","'s","scope","in","Python","<","3.8",".","In","the","future",",","with","Python","3.8","support",",","we","can","use","the","`","stacklevel","`","arg",",","which","allows","the","logger","to","fetch","the","correct","calling","file\/line","and","also","removes","the","need","for","this","getter","method",":","`","logger.info","(","msg=","''","Hello","world","''",",","stacklevel=2",")","`"]
code: def get_logger(self, log_to_stdout: bool = True) -> logging.Logger:
      """
      Returns the underlying Logger, with the `propagate` attribute set
      to the same value as `log_to_stdout`. For example, when
      `log_to_stdout = False`, we do not want the `DatasetLogger` to
      propagate up to the base Logger which writes to stdout.
  
      This is a workaround needed due to the DatasetLogger wrapper object
      not having access to the log caller's scope in Python <3.8.
      In the future, with Python 3.8 support, we can use the `stacklevel` arg,
      which allows the logger to fetch the correct calling file/line and
      also removes the need for this getter method:
      `logger.info(msg="Hello world", stacklevel=2)`
      """
      if self._logger is None:
          self._logger = self._initialize_logger()
      self._logger.propagate = log_to_stdout
      return self._logger
  
file_path: ray/python/ray/data/_internal/dataset_logger.py
imports: import logging
  import os
  import ray
  from ray._private.ray_constants import LOGGER_FORMAT, LOGGER_LEVEL
label_desc: Use image node_id 3 for calling the DatasetLogger obj's underlying member method code with example usage: obj.get_logger(log_to_stdout) and returns: self