code: def log_collector():
      orig_dr_logger = sphinx_gallery.docs_resolv.logger
      orig_gg_logger = sphinx_gallery.gen_gallery.logger
      orig_gr_logger = sphinx_gallery.gen_rst.logger
      app = FakeSphinxApp()
      sphinx_gallery.docs_resolv.logger = app
      sphinx_gallery.gen_gallery.logger = app
      sphinx_gallery.gen_rst.logger = app
      try:
          yield app
      finally:
          sphinx_gallery.docs_resolv.logger = orig_dr_logger
          sphinx_gallery.gen_gallery.logger = orig_gg_logger
          sphinx_gallery.gen_rst.logger = orig_gr_logger
  
file_path: tensorly/doc/sphinx_ext/sphinx_gallery/tests/conftest.py
imports: from __future__ import division, absolute_import, print_function
  import collections
  import logging
  import pytest
  import sphinx_gallery.docs_resolv
  import sphinx_gallery.gen_gallery
  import sphinx_gallery.gen_rst
  from sphinx_gallery import sphinx_compatibility
label_desc: Use image node_id 2 for calling a global function with example usage: log_collector() without return types