code: def test_log_extra(capsys):
      """Base test for the log_step_extra function"""
      n_cats = 3
      n_dogs = 2
  
      test_df = pd.DataFrame(
          {
              "id": range(n_cats + n_dogs),
              "animals": ["dog"] * n_dogs + ["cat"] * n_cats,
          }
      )
  
      def cat_counter(df):
          return f"cats={(df['animals']=='cat').sum()}"
  
      @log_step_extra(cat_counter)
      def do_nothing(df, *args, **kwargs):
          return df
  
      @log_step_extra(cat_counter)
      def double_df(df, *args, **kwargs):
          return pd.concat([df, df], axis=0)
  
      test_df.pipe(do_nothing).pipe(double_df)
  
      captured = capsys.readouterr()
      print_statements = captured.out.split("\n")
  
      assert f"cats={n_cats}" in print_statements[0]
      assert f"cats={2*n_cats}" in print_statements[1]
  
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 19 for calling a global function with example usage: test_log_extra(capsys) and returns: str, unknown, df, pd