code: def test_log_prefix(func_name):
      func = getattr(log, func_name)
      msg = f"{func_name} message"
      f = io.StringIO()
      with redirect_stdout(f):
          func(msg)
      out = f.getvalue()
      assert out  # sanity check
      clean_out = r_ansi.sub("", out)
      line = next(line for line in clean_out.splitlines())
      assert line == f"{func_name.upper()}: {msg}"
  
file_path: numpy/numpy/distutils/tests/test_log.py
imports: import io
  import re
  from contextlib import redirect_stdout
  import pytest
  from numpy.distutils import log
label_desc: Use image node_id 3 for calling a global function with example usage: test_log_prefix(func_name) without return types