code: def test_logging_default(caplog, config):
      """
      Test default logging configuration.
      """
      if config is None:
          ctx = contextlib.nullcontext()
      else:
          ctx = new_config(config)
      with ctx:
          d = logging.getLogger("distributed")
          assert isinstance(d.handlers[0], logging.StreamHandler)
  
          dfb = logging.getLogger("distributed.foo.bar")
          dfc = logging.getLogger("distributed.client")
          f = logging.getLogger("foo")
          fb = logging.getLogger("foo.bar")
  
          with captured_handler(d.handlers[0]) as distributed_log:
              d.debug("1: debug")
              d.info("2: info")
              dfb.info("3: info")
              fb.info("4: info")
              fb.error("5: error")
              f.info("6: info")
              f.error("7: error")
              dfc.info("8: ignore me")
              dfc.warning("9: important")
  
          # default logging sets propagate=False so caplog does not capture
          # distributed log records
          assert caplog.record_tuples == [
              # Info logs of foreign libraries are not logged because default is
              # WARNING
              ("foo.bar", logging.ERROR, "5: error"),
              ("foo", logging.ERROR, "7: error"),
          ]
          assert re.match(
              r"\A\d+-\d+-\d+ \d+:\d+:\d+,\d+ - distributed - INFO - 2: info\n"
              r"\d+-\d+-\d+ \d+:\d+:\d+,\d+ - distributed.foo.bar - INFO - 3: info\n"
              r"\d+-\d+-\d+ \d+:\d+:\d+,\d+ - distributed.client - WARNING - 9: important\n\Z",
              distributed_log.getvalue(),
          )
  
imports: from __future__ import annotations
  import contextlib
  import logging
  import os
  import re
  import subprocess
  import sys
  import tempfile
  import textwrap
  import pytest
  import yaml
  import dask.config
  from distributed.config import initialize_logging
  from distributed.utils_test import captured_handler, new_config, new_config_file
label_desc: Use image node_id 1 for calling a global function with example usage: test_logging_default(caplog, config) without return types