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 __init__(
      self,
      pre_replay: Optional[callable] = None,
      post_replay: Optional[callable] = None,
  ):
      def _noop():
          pass
  
      self.captured = []
      self.pre_replay = pre_replay or _noop
      self.post_replay = post_replay or _noop
  
file_path: icevision/icevision/utils/logger_utils.py
imports: from icevision.imports import *
label_desc: Use image node_id 1 to create a new ReplaySink object  with example: obj = ReplaySink(pre_replay, post_replay)