code: def test_logging_on_and_off(caplog):
      """Test that switching logging on and off works."""
      from satpy.utils import logging_off, logging_on
  
      logger = logging.getLogger("satpy.silly")
      logging_on()
      with caplog.at_level(logging.WARNING):
          logger.debug("I'd like to leave the army please, sir.")
          logger.warning("Stop that!  It's SILLY.")
      assert "Stop that!  It's SILLY" in caplog.text
      assert (
          "I'd like to leave the army please, sir." not in caplog.text
      )
      logging_off()
      with caplog.at_level(logging.DEBUG):
          logger.warning("You've got a nice army base here, Colonel.")
      assert (
          "You've got a nice army base here, Colonel."
          not in caplog.text
      )
  
imports: from __future__ import annotations
  import datetime
  import logging
  import typing
  import unittest
  import warnings
  from math import sqrt
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.tests.utils import xfail_skyfield_unstable_numpy2
  from satpy.utils import angle2xyz, get_legacy_chunk_size, get_satpos, import_error_helper, lonlat2xyz, proj_units_to_meters, xyz2angle, xyz2lonlat
label_desc: Use image node_id 3 for calling a global function with example usage: test_logging_on_and_off(caplog) without return types