code: def test_logger_messages_present(posterior):
      f = io.StringIO()
      with contextlib.redirect_stderr(f):
          posterior.sample()
      s = f.getvalue()
      assert "Rejecting initial value:" in s
  
imports: import contextlib
  import io
  import pytest
  import stan
label_desc: Use image node_id 2 for calling a global function with example usage: test_logger_messages_present(posterior) without return types