code: def test_info_location(app, status, warning):
      logging.setup(app, status, warning)
      logger = logging.getLogger(__name__)
  
      logger.info("message1", location="index")
      assert "index.txt: message1" in status.getvalue()
  
      logger.info("message2", location=("index", 10))
      assert "index.txt:10: message2" in status.getvalue()
  
      logger.info("message3", location=None)
      assert "\nmessage3" in status.getvalue()
  
      node = nodes.Node()
      node.source, node.line = ("index.txt", 10)
      logger.info("message4", location=node)
      assert "index.txt:10: message4" in status.getvalue()
  
      node.source, node.line = ("index.txt", None)
      logger.info("message5", location=node)
      assert "index.txt:: message5" in status.getvalue()
  
      node.source, node.line = (None, 10)
      logger.info("message6", location=node)
      assert "<unknown>:10: message6" in status.getvalue()
  
      node.source, node.line = (None, None)
      logger.info("message7", location=node)
      assert "\nmessage7" in status.getvalue()
  
imports: import codecs
  import os
  import os.path
  import pytest
  from docutils import nodes
  from sphinx.errors import SphinxWarning
  from sphinx.testing.util import strip_escseq
  from sphinx.util import logging, osutil
  from sphinx.util.console import colorize
  from sphinx.util.logging import is_suppressed_warning, prefixed_warnings
  from sphinx.util.parallel import ParallelTasks
label_desc: Use image node_id 9 for calling a global function with example usage: test_info_location(app, status, warning) without return types