code: def test_template_loader_debugging(test_apps, monkeypatch):
      from blueprintapp import app
  
      called = []
  
      class _TestHandler(logging.Handler):
          def handle(self, record):
              called.append(True)
              text = str(record.msg)
              assert (
                  "1: trying loader of application 'blueprintapp'"
                  in text
              )
              assert (
                  "2: trying loader of blueprint 'admin' (blueprintapp.apps.admin)"
              ) in text
              assert (
                  "trying loader of blueprint 'frontend' (blueprintapp.apps.frontend)"
              ) in text
              assert "Error: the template could not be found" in text
              assert (
                  "looked up from an endpoint that belongs to the blueprint 'frontend'"
              ) in text
              assert (
                  "See https://flask.palletsprojects.com/blueprints/#templates"
                  in text
              )
  
      with app.test_client() as c:
          monkeypatch.setitem(
              app.config, "EXPLAIN_TEMPLATE_LOADING", True
          )
          monkeypatch.setattr(
              logging.getLogger("blueprintapp"),
              "handlers",
              [_TestHandler()],
          )
  
          with pytest.raises(TemplateNotFound) as excinfo:
              c.get("/missing")
  
          assert "missing_template.html" in str(excinfo.value)
  
      assert len(called) == 1
  
imports: import logging
  import pytest
  import werkzeug.serving
  from jinja2 import TemplateNotFound
  from markupsafe import Markup
  import flask
label_desc: Use image node_id 31 for calling a global function with example usage: test_template_loader_debugging(test_apps, monkeypatch) without return types