class_docstr: Store logging.
  
  This will remove all other logging handlers, and return the handler to
  stdout when complete.
class_docstr_tok: ["Store","logging",".","This","will","remove","all","other","logging","handlers",",","and","return","the","handler","to","stdout","when","complete","."]
code: def __enter__(self):  # noqa: D105
      if self.verbose is not None:
          self._ctx = use_log_level(self.verbose)
      else:
          self._ctx = contextlib.nullcontext()
      self._data = ClosingStringIO()
      self._lh = logging.StreamHandler(self._data)
      self._lh.setFormatter(logging.Formatter("%(message)s"))
      self._lh._mne_file_like = True  # monkey patch for warn() use
      _remove_close_handlers(logger)
      logger.addHandler(self._lh)
      self._ctx.__enter__()
      return self._data
  
imports: import contextlib
  import importlib
  import inspect
  import logging
  import os.path
  import re
  import sys
  import warnings
  from io import StringIO
  from typing import Any, Callable, TypeVar
  from decorator import FunctionMaker
  from .docs import fill_doc
label_desc: Use image node_id 2 for calling the catch_logging obj's underlying member method code with example usage: obj.__enter__() and returns: self