class_docstr: Helper class to simplify the statistics logging setup. All statistics defined for the given env are sent
  to a console writer.
  
  Limitation: It can only handle a single environment.
class_docstr_tok: ["Helper","class","to","simplify","the","statistics","logging","setup",".","All","statistics","defined","for","the","given","env","are","sent","to","a","console","writer",".","Limitation",":","It","can","only","handle","a","single","environment","."]
docstr: Ensure that the statistics of the current log step is calculated and written to the console 
docstr_tok: ["Ensure","that","the","statistics","of","the","current","log","step","is","calculated","and","written","to","the","console"]
code: def __exit__(self, exc_type, exc_val, exc_tb) -> None:
      """Ensure that the statistics of the current log step is calculated and written to the console"""
      # we need to trigger the episode statistics calculation if we stopped the simulation before it was done
      self.env.reset()
  
      # calculate the epoch statistics, based on the individual episode statistics produced in the loop above.
      self.env.write_epoch_stats()
  
imports: import glob
  import os
  import pickle
  import sys
  from typing import Union
  from omegaconf import DictConfig, OmegaConf
  from maze.core.env.base_env import BaseEnv
  from maze.core.log_events.log_events_writer_registry import LogEventsWriterRegistry
  from maze.core.log_stats.log_stats import GlobalLogState
  from maze.core.log_stats.log_stats import register_log_stats_writer
  from maze.core.log_stats.log_stats_env import LogStatsEnv
  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_registry import TrajectoryWriterRegistry
  from maze.utils.bcolors import BColors
label_desc: Use image node_id 3 for calling the SimpleStatsLoggingSetup obj's underlying member method code with example usage: obj.__exit__(exc_type, exc_val, exc_tb) without return types