code: def test_log_cli_enabled_disabled(
      pytester: Pytester, enabled: bool
  ) -> None:
      msg = "critical message logged by test"
      pytester.makepyfile(
          """
          import logging
          def test_log_cli():
              logging.critical("{}")
      """.format(
              msg
          )
      )
      if enabled:
          pytester.makeini(
              """
              [pytest]
              log_cli=true
          """
          )
      result = pytester.runpytest()
      if enabled:
          result.stdout.fnmatch_lines(
              [
                  "test_log_cli_enabled_disabled.py::test_log_cli ",
                  "*-- live log call --*",
                  "CRITICAL *test_log_cli_enabled_disabled.py* critical message logged by test",
                  "PASSED*",
              ]
          )
      else:
          assert msg not in result.stdout.str()
  
imports: import io
  import os
  import re
  from typing import cast
  import pytest
  from _pytest.capture import CaptureManager
  from _pytest.config import ExitCode
  from _pytest.fixtures import FixtureRequest
  from _pytest.pytester import Pytester
  from _pytest.terminal import TerminalReporter
label_desc: Use image node_id 7 for calling a global function with example usage: test_log_cli_enabled_disabled(pytester, enabled) without return types