class_docstr: Capture messages and replays them after leaving the block.
  
  # Examples
  ```python
  pre_replay = lambda: logger.info("something will happen")
  post_replay = lambda: logger.info("something did happen")
  with ReplaySink(pre_replay=pre_replay, post_replay=post_replay) as sink:
      logger.info('captured message')
  ```
code: def __exit__(self, type, value, traceback):
      logger_default_config()
      if self.captured:
          self.pre_replay()
  
          for msg in self.captured:
              record = msg.record
  
              level = record["level"].name
              try:
                  logger.level(level)
              except ValueError:
                  # If the level 'name' is not registered, use its 'no' instead
                  level = record["level"].no
  
              patched = logger.patch(lambda r: r.update(record))
              patched.log(level, record["message"])
  
          self.post_replay()
  
file_path: icevision/icevision/utils/logger_utils.py
imports: from icevision.imports import *
label_desc: Use image node_id 4 for calling the ReplaySink obj's underlying member method code with example usage: obj.__exit__(type, value, traceback) without return types