code: def test_logging_simple_under_distributed():
      """
      Test simple ("old-style") logging configuration under the distributed key.
      """
      c = {
          "distributed": {
              "logging": {
                  "distributed.foo": "info",
                  "distributed.foo.bar": "error",
              }
          }
      }
      # Must test using a subprocess to avoid wrecking pre-existing configuration
      with new_config_file(c):
          code = """if 1:
              import logging
              import dask
  
              from distributed.utils_test import captured_handler
  
              d = logging.getLogger('distributed')
              assert len(d.handlers) == 1
              assert isinstance(d.handlers[0], logging.StreamHandler)
              df = logging.getLogger('distributed.foo')
              dfb = logging.getLogger('distributed.foo.bar')
  
              with captured_handler(d.handlers[0]) as distributed_log:
                  df.info("1: info")
                  dfb.warning("2: warning")
                  dfb.error("3: error")
  
              distributed_log = distributed_log.getvalue().splitlines()
  
              assert len(distributed_log) == 2, (dask.config.config, distributed_log)
              """
  
          subprocess.check_call([sys.executable, "-c", code])
  
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 2 for calling a global function with example usage: test_logging_simple_under_distributed() without return types