code: def test_register_custom_logger():
      logged_messages = []
  
      class CustomLogger:
          def custom_info(self, msg: str) -> None:
              logged_messages.append(msg)
  
          def custom_warning(self, msg: str) -> None:
              logged_messages.append(msg)
  
      custom_logger = CustomLogger()
      lgb.register_logger(
          custom_logger,
          info_method_name="custom_info",
          warning_method_name="custom_warning",
      )
  
      lgb.basic._log_info("info message")
      lgb.basic._log_warning("warning message")
  
      expected_log = ["info message", "warning message"]
      assert logged_messages == expected_log
  
      logged_messages = []
      X = np.array(
          [[1, 2, 3], [1, 2, 4], [1, 2, 4], [1, 2, 3]], dtype=np.float32
      )
      y = np.array([0, 1, 1, 0])
      lgb_data = lgb.Dataset(X, y)
      lgb.train(
          {"objective": "binary", "metric": "auc"},
          lgb_data,
          num_boost_round=10,
          valid_sets=[lgb_data],
          categorical_feature=[1],
      )
      assert logged_messages, "custom logger was not called"
  
imports: import logging
  import numpy
  import pytest
  import lightgbm
label_desc: Use image node_id 3 for calling a global function with example usage: test_register_custom_logger() without return types