input: Write a python function to log an error message using the logging module when an exception occurs.
  assert run_code_with_logging(lambda: 1/0) == "An error occurred: division by zero"
  assert run_code_with_logging(lambda: [1, 2, 3][3]) == "An error occurred: list index out of range"
  assert run_code_with_logging(lambda: int('abc')) == "An error occurred: invalid literal for int() with base 10: 'abc'"
output: import logging
  
  def run_code_with_logging(func):
      logging.basicConfig(level=logging.ERROR)
      try:
          func()
      except Exception as e:
          logging.error(f"An error occurred: {e}")
          return f"An error occurred: {e}"