code: def test_proj_debug_logging__error(capsys):
      with proj_logging_env(), pytest.raises(CRSError):
          CRS("INVALID STRING")
          captured = capsys.readouterr()
          if os.environ.get("PROJ_DEBUG") == "3":
              assert "PROJ_TRACE" in captured.err
              assert "PROJ_DEBUG" in captured.err
              assert "PROJ_ERROR" in captured.err
          elif os.environ.get("PROJ_DEBUG") == "2":
              assert "PROJ_TRACE" not in captured.err
              assert "PROJ_DEBUG" in captured.err
              assert "PROJ_ERROR" in captured.err
          else:
              assert captured.err == ""
              assert captured.out == ""
  
imports: import logging
  import os
  from contextlib import contextmanager
  from pathlib import Path
  from unittest.mock import patch
  import pytest
  import pyproj._datadir
  from pyproj import CRS, Transformer, get_codes, set_use_global_context
  from pyproj._datadir import _pyproj_global_context_initialize
  from pyproj.datadir import DataDirError, append_data_dir, get_data_dir, get_user_data_dir, set_data_dir
  from pyproj.enums import PJType
  from pyproj.exceptions import CRSError
  from test.conftest import proj_env
label_desc: Use image node_id 23 for calling a global function with example usage: test_proj_debug_logging__error(capsys) without return types