code: def test_logging():
      rep = Report(ValueError, 20, "msg", "fix")
      str_io = StringIO()
      logger = logging.getLogger("test.logger")
      logger.setLevel(30)  # defaultish level
      logger.addHandler(logging.StreamHandler(str_io))
      rep.log_raise(logger)
      assert str_io.getvalue() == ""
      rep.problem_level = 30
      rep.log_raise(logger)
      assert str_io.getvalue() == "msg; fix\n"
      str_io.truncate(0)
      str_io.seek(0)
  
file_path: nibabel/nibabel/tests/test_batteryrunners.py
imports: import logging
  from io import StringIO
  import pytest
  from ..batteryrunners import BatteryRunner, Report
label_desc: Use image node_id 8 for calling a global function with example usage: test_logging() without return types