class_docstr: Log to the local file system in CSV format.
  
  Logs are saved to ``os.path.join(root_dir, name, version)``.
  
  Args:
      root_dir: The root directory in which all your experiments with different names and versions will be stored.
      name: Experiment name. Defaults to ``'lightning_logs'``.
      version: Experiment version. If version is not specified the logger inspects the save
          directory for existing versions, then automatically assigns the next available version.
      prefix: A string to put at the beginning of metric keys.
      flush_logs_every_n_steps: How often to flush logs to disk (defaults to every 100 steps).
  
  Example::
  
      from lightning.fabric.loggers import CSVLogger
  
      logger = CSVLogger("path/to/logs/root", name="my_model")
      logger.log_metrics({"loss": 0.235, "acc": 0.75})
      logger.finalize("success")
code: def __init__(
      self,
      root_dir: _PATH,
      name: str = "lightning_logs",
      version: Optional[Union[int, str]] = None,
      prefix: str = "",
      flush_logs_every_n_steps: int = 100,
  ):
      super().__init__()
      root_dir = os.fspath(root_dir)
      self._root_dir = root_dir
      self._name = name or ""
      self._version = version
      self._prefix = prefix
      self._fs = get_filesystem(root_dir)
      self._experiment: Optional[_ExperimentWriter] = None
      self._flush_logs_every_n_steps = flush_logs_every_n_steps
  
imports: import csv
  import logging
  import os
  from argparse import Namespace
  from typing import Any, Dict, List, Optional, Set, Union
  from torch import Tensor
  from typing_extensions import override
  from lightning.fabric.loggers.logger import Logger, rank_zero_experiment
  from lightning.fabric.utilities.cloud_io import _is_dir, get_filesystem
  from lightning.fabric.utilities.logger import _add_prefix
  from lightning.fabric.utilities.rank_zero import rank_zero_only, rank_zero_warn
  from lightning.fabric.utilities.types import _PATH
label_desc: Use image node_id 1 to create a new CSVLogger object from inherited base classes: Logger with example: obj = CSVLogger(root_dir, name, version, prefix, flush_logs_every_n_steps)