code: def test_log_error(log_error, capsys, test_df):
      """Test logging of shape can be switched on and off"""
  
      err_msg = "This is a test Exception"
  
      @log_step(log_error=log_error)
      def do_nothing(df, *args, **kwargs):
          raise RuntimeError(err_msg)
  
      err_reraised = False
      try:
          test_df.pipe(do_nothing)
      except RuntimeError:
          err_reraised = True
  
      captured = capsys.readouterr()
  
      assert err_reraised
      assert "FAILED" in captured.out
      assert (
          f"FAILED with error: {err_msg}" in captured.out
      ) == log_error
  
imports: import logging
  import numpy
  import pandas
  import pytest
  from sklego.pandas_utils import _add_lagged_numpy_columns, _add_lagged_pandas_columns, add_lags, log_step, log_step_extra
label_desc: Use image node_id 18 for calling a global function with example usage: test_log_error(log_error, capsys, test_df) without return types