class_docstr: Simple setup for environment monitoring.
  
  Logs the following data:
  
    - Epoch statistics (console + Tensorboard format)
    - Environment events (TSV files, one per event type)
    - Trajectory data
class_docstr_tok: ["Simple","setup","for","environment","monitoring",".","Logs","the","following","data",":","-","Epoch","statistics","(","console","+","Tensorboard","format",")","-","Environment","events","(","TSV","files",",","one","per","event","type",")","-","Trajectory","data"]
docstr: Ensure data are written out in case the rollout ended in the middle of episode.
docstr_tok: ["Ensure","data","are","written","out","in","case","the","rollout","ended","in","the","middle","of","episode","."]
code: def __exit__(self, exc_type, exc_val, exc_tb) -> None:
      """
      Ensure data are written out in case the rollout ended in the middle of episode.
      """
      self.env.reset()
      self.env.write_epoch_stats()
  
file_path: maze/maze/core/trajectory_recording/utils/monitoring_setup.py
imports: from typing import TypeVar
  from maze.core.log_events.log_events_writer_registry import LogEventsWriterRegistry
  from maze.core.log_events.log_events_writer_tsv import LogEventsWriterTSV
  from maze.core.log_stats.log_stats import register_log_stats_writer
  from maze.core.log_stats.log_stats_writer_console import LogStatsWriterConsole
  from maze.core.log_stats.log_stats_writer_tensorboard import LogStatsWriterTensorboard
  from maze.core.trajectory_recording.writers.trajectory_writer_file import TrajectoryWriterFile
  from maze.core.trajectory_recording.writers.trajectory_writer_registry import TrajectoryWriterRegistry
  from maze.core.wrappers.log_stats_wrapper import LogStatsWrapper
  from maze.core.wrappers.trajectory_recording_wrapper import TrajectoryRecordingWrapper
label_desc: Use image node_id 3 for calling the MonitoringSetup obj's underlying member method code with example usage: obj.__exit__(exc_type, exc_val, exc_tb) without return types