code: def test_add_existing_level(caplog, dt):
      # Common pattern to configure logging level in external libraries
      # eg:
      # https://github.com/bokeh/bokeh/blob/04bb30fef2e72e64baaa8b2f330806d5bfdd3b11/
      # bokeh/util/logconfig.py#L79-L85
      TRACE2 = 4  # noqa: N806
      logging.addLevelName(TRACE2, "TRACE2")
      logging.TRACE2 = TRACE2
  
      dvc.logger.add_logging_level("TRACE2", 2)
  
      # DVC sets all expected entrypoints, but doesn't override the level
      assert logging.TRACE2 == 4
      assert hasattr(logging, "trace2")
      assert hasattr(logger, "trace2")
      assert logging.getLevelName("TRACE2") == 4
  
      # The TRACE2 logging level uses the original, higher logging level
      with caplog.at_level(logging.TRACE2, logger="dvc"):
          logger.trace2("TRACE2")
      assert len(caplog.records) == 1
  
      (record,) = caplog.records
      assert record.levelno == 4
      assert record.levelname == "TRACE2"
      assert record.message == "TRACE2"
  
imports: import logging
  import time
  import traceback
  from datetime import datetime
  import colorama
  import pytest
  import dvc.logger
  from dvc.exceptions import DvcException
label_desc: Use image node_id 5 for calling a global function with example usage: test_add_existing_level(caplog, dt) without return types